2023-01-05 12:34:34 +00:00
|
|
|
import {
|
|
|
|
listActionsProps,
|
|
|
|
pageListProps,
|
|
|
|
sortPageProps,
|
|
|
|
} from "@saleor/fixtures";
|
|
|
|
import { menuList } from "@saleor/navigation/fixtures";
|
2020-05-14 09:30:32 +00:00
|
|
|
import { MenuListUrlSortField } from "@saleor/navigation/urls";
|
2023-01-05 12:34:34 +00:00
|
|
|
import Decorator from "@saleor/storybook/Decorator";
|
2022-05-31 12:53:16 +00:00
|
|
|
import { PaginatorContextDecorator } from "@saleor/storybook/PaginatorContextDecorator";
|
2019-06-19 14:40:52 +00:00
|
|
|
import { storiesOf } from "@storybook/react";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2023-01-05 12:34:34 +00:00
|
|
|
import MenuListPage, { MenuListPageProps } from "./MenuListPage";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const props: MenuListPageProps = {
|
|
|
|
...pageListProps.default,
|
|
|
|
...listActionsProps,
|
2019-12-17 17:13:56 +00:00
|
|
|
...sortPageProps,
|
2019-06-19 14:40:52 +00:00
|
|
|
menus: menuList,
|
2019-12-17 17:13:56 +00:00
|
|
|
onDelete: () => undefined,
|
|
|
|
sort: {
|
|
|
|
...sortPageProps.sort,
|
2022-06-21 09:36:55 +00:00
|
|
|
sort: MenuListUrlSortField.name,
|
|
|
|
},
|
2019-06-19 14:40:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-05 12:34:34 +00:00
|
|
|
storiesOf("Navigation / Menu list", module)
|
2019-06-19 14:40:52 +00:00
|
|
|
.addDecorator(Decorator)
|
2022-05-31 12:53:16 +00:00
|
|
|
.addDecorator(PaginatorContextDecorator)
|
2019-06-19 14:40:52 +00:00
|
|
|
.add("default", () => <MenuListPage {...props} />)
|
|
|
|
.add("loading", () => (
|
|
|
|
<MenuListPage {...props} disabled={true} menus={undefined} />
|
|
|
|
))
|
|
|
|
.add("no data", () => <MenuListPage {...props} menus={[]} />);
|