2019-06-19 14:40:52 +00:00
|
|
|
import Button from "@material-ui/core/Button";
|
|
|
|
import AddIcon from "@material-ui/icons/Add";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-08-26 14:51:47 +00:00
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
import AppHeader from "@saleor/components/AppHeader";
|
|
|
|
import Container from "@saleor/components/Container";
|
|
|
|
import PageHeader from "@saleor/components/PageHeader";
|
2019-08-26 14:51:47 +00:00
|
|
|
import { sectionNames } from "@saleor/intl";
|
2019-08-09 11:14:35 +00:00
|
|
|
import { ListActions, PageListProps } from "@saleor/types";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { MenuList_menus_edges_node } from "../../types/MenuList";
|
|
|
|
import MenuList from "../MenuList";
|
|
|
|
|
|
|
|
export interface MenuListPageProps extends PageListProps, ListActions {
|
|
|
|
menus: MenuList_menus_edges_node[];
|
|
|
|
onBack: () => void;
|
|
|
|
onDelete: (id: string) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const MenuListPage: React.StatelessComponent<MenuListPageProps> = ({
|
|
|
|
disabled,
|
|
|
|
onAdd,
|
|
|
|
onBack,
|
|
|
|
...listProps
|
2019-08-26 14:51:47 +00:00
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
return (
|
|
|
|
<Container>
|
|
|
|
<AppHeader onBack={onBack}>
|
|
|
|
{intl.formatMessage(sectionNames.configuration)}
|
|
|
|
</AppHeader>
|
|
|
|
<PageHeader title={intl.formatMessage(sectionNames.navigation)}>
|
|
|
|
<Button
|
|
|
|
color="primary"
|
|
|
|
disabled={disabled}
|
|
|
|
variant="contained"
|
|
|
|
onClick={onAdd}
|
|
|
|
>
|
|
|
|
<FormattedMessage
|
|
|
|
defaultMessage="Add Menu"
|
|
|
|
description="button"
|
|
|
|
id="menuListPageAddMenu"
|
|
|
|
/>
|
|
|
|
<AddIcon />
|
|
|
|
</Button>
|
|
|
|
</PageHeader>
|
|
|
|
<MenuList disabled={disabled} {...listProps} />
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
};
|
2019-06-19 14:40:52 +00:00
|
|
|
MenuListPage.displayName = "MenuListPage";
|
|
|
|
export default MenuListPage;
|