saleor-dashboard/src/navigation/components/MenuListPage/MenuListPage.stories.tsx

35 lines
1 KiB
TypeScript
Raw Normal View History

2023-01-05 12:34:34 +00:00
import {
listActionsProps,
pageListProps,
sortPageProps,
} from "@dashboard/fixtures";
import { menuList } from "@dashboard/navigation/fixtures";
import { MenuListUrlSortField } from "@dashboard/navigation/urls";
import Decorator from "@dashboard/storybook/Decorator";
import { PaginatorContextDecorator } from "@dashboard/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,
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)
Enhancements to pagination navigation (#2063) * Update macaw to include Paginator changes * Add link support to TablePagination component * Rewrite usePaginator to use context and links instead of onClick * Refactor ProductList to use new usePaginator hook * Add decorator for PaginatorContext in ProductList stories * Refactor AppList to use new usePaginator hook * Refactor AttributeList to use new usePaginator hook * Add missing pagination props for local pagination to AttributeValues * Refactor CategoryList to use new usePaginator hook * Refactor CategoryDetails to use useLocalPaginator and context * Refactor CollectionList to use new usePaginator hook * Refactor CollectionProducts to use new usePaginator hook * Refactor CustomerList to use new usePaginator hook * Refactor VoucherDetailsPage to use PaginationContext * Refactor SaleDetails to use PaginatorContext * Refactor SaleList to use new usePaginator hook * Refactor VoucherList to use new usePaginator hook * Fix type error in paginatorContextValues fixture * Refactor GitfCardList to use new usePaginator hook * Remove unused imports * Refactor MenuList to use new usePaginator hook * Refactor OrderDraftList to use new usePaginator hook * Refactor OrderListPage to use new usePaginator hook * Refactor PageList to use new usePaginator hook * Refactor PageTypeList to use new usePaginator hook * Refactor PermissionGroupList to use new usePaginator hook * Refactor PluginsList to use new usePaginator hook * Refactor ProductTypeList to use new usePaginator hook * Refactor ShippingMethodProducts to use PaginationContext * Refactor ShippingZonesList to use new usePaginator hook * Refactor StaffList to use new usePaginator hook * Fix TS errors * Update TranslationEntities and TranslationFields to use new usePaginator * Refactor WarehouseList to use new usePaginator hook * Fix errors in stories that didn't use PaginationContextDecorator * Mention changes in changelog * Update to latest macaw version, update snapshots
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={[]} />);