
* Extract "webhooks & events" to separate page * Create separate /custom-app/ path for custom apps with webhooks * Change all /webhooks/ paths to /custom-apps/ * Update messages * Update generated graphql types * Create findById util * Refactor consts and resolvers for custom app urls * Fix app graphql fragment * Update Miscellaneous icon for Webhooks and Events * Add tests for custom apps utils * Fix dark-mode Miscellaneous icon for Webhooks and Events * adjustments for autotests Co-authored-by: karolm-saleor <karol.macheta@saleor.io>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { Card, CardContent, Typography } from "@material-ui/core";
|
|
import CardTitle from "@saleor/components/CardTitle";
|
|
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
|
import { ChangeEvent } from "@saleor/hooks/useForm";
|
|
import React from "react";
|
|
import { useIntl } from "react-intl";
|
|
|
|
import { WebhookFormData } from "../WebhookDetailsPage";
|
|
import { messages } from "./messages";
|
|
|
|
interface WebhookStatusProps {
|
|
data: boolean;
|
|
disabled: boolean;
|
|
onChange: (event: ChangeEvent, cb?: () => void) => void;
|
|
}
|
|
|
|
const WebhookStatus: React.FC<WebhookStatusProps> = ({
|
|
data,
|
|
disabled,
|
|
onChange,
|
|
}) => {
|
|
const intl = useIntl();
|
|
return (
|
|
<Card>
|
|
<CardTitle title={intl.formatMessage(messages.webhookStatus)} />
|
|
<CardContent>
|
|
<Typography variant="body1">
|
|
{intl.formatMessage(messages.webhookActiveDescription)}
|
|
</Typography>
|
|
<ControlledCheckbox
|
|
name={"isActive" as keyof WebhookFormData}
|
|
label={intl.formatMessage(messages.webhookActive)}
|
|
checked={data}
|
|
onChange={onChange}
|
|
disabled={disabled}
|
|
/>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
};
|
|
WebhookStatus.displayName = "WebhookStatus";
|
|
export default WebhookStatus;
|