2019-10-09 20:50:03 +00:00
|
|
|
import Button from "@material-ui/core/Button";
|
2019-10-09 06:01:52 +00:00
|
|
|
import React from "react";
|
2019-10-09 20:50:03 +00:00
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
2019-10-09 06:01:52 +00:00
|
|
|
|
|
|
|
import AppHeader from "@saleor/components/AppHeader";
|
|
|
|
import Container from "@saleor/components/Container";
|
|
|
|
import PageHeader from "@saleor/components/PageHeader";
|
|
|
|
import { sectionNames } from "@saleor/intl";
|
|
|
|
import { PageListProps } from "@saleor/types";
|
2019-10-09 06:56:46 +00:00
|
|
|
import { Webhooks_webhooks_edges_node } from "../../types/Webhooks";
|
2019-10-09 06:01:52 +00:00
|
|
|
import WebhooksList from "../WebhooksList/WebhooksList";
|
|
|
|
|
|
|
|
export interface WebhooksListPageProps extends PageListProps {
|
2019-10-09 06:56:46 +00:00
|
|
|
webhooks: Webhooks_webhooks_edges_node[];
|
2019-10-09 06:01:52 +00:00
|
|
|
onBack: () => void;
|
2019-10-10 05:38:21 +00:00
|
|
|
onRemove: () => void;
|
2019-10-09 06:01:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const WebhooksListPage: React.StatelessComponent<WebhooksListPageProps> = ({
|
|
|
|
disabled,
|
|
|
|
settings,
|
2019-10-09 20:50:03 +00:00
|
|
|
onAdd,
|
2019-10-09 06:01:52 +00:00
|
|
|
onBack,
|
|
|
|
onNextPage,
|
|
|
|
onPreviousPage,
|
|
|
|
onRowClick,
|
2019-10-10 05:38:21 +00:00
|
|
|
onRemove,
|
2019-10-09 06:01:52 +00:00
|
|
|
onUpdateListSettings,
|
|
|
|
pageInfo,
|
|
|
|
webhooks
|
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
return (
|
|
|
|
<Container>
|
|
|
|
<AppHeader onBack={onBack}>
|
|
|
|
{intl.formatMessage(sectionNames.configuration)}
|
|
|
|
</AppHeader>
|
2019-10-09 20:50:03 +00:00
|
|
|
<PageHeader title={intl.formatMessage(sectionNames.webhooks)}>
|
|
|
|
<Button onClick={onAdd} variant="contained" color="primary">
|
|
|
|
<FormattedMessage
|
|
|
|
defaultMessage="Create webhook"
|
|
|
|
description="button"
|
|
|
|
/>
|
|
|
|
</Button>
|
|
|
|
</PageHeader>
|
2019-10-09 06:01:52 +00:00
|
|
|
<WebhooksList
|
|
|
|
disabled={disabled}
|
|
|
|
settings={settings}
|
|
|
|
webhooks={webhooks}
|
|
|
|
onNextPage={onNextPage}
|
|
|
|
onPreviousPage={onPreviousPage}
|
2019-10-10 05:38:21 +00:00
|
|
|
onRemove={onRemove}
|
2019-10-09 06:01:52 +00:00
|
|
|
onUpdateListSettings={onUpdateListSettings}
|
|
|
|
onRowClick={onRowClick}
|
|
|
|
pageInfo={pageInfo}
|
|
|
|
/>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
WebhooksListPage.displayName = "WebhooksListPage";
|
|
|
|
export default WebhooksListPage;
|