saleor-dashboard/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx

68 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-09-12 13:31:08 +00:00
import {
filterPageProps,
2019-09-12 13:31:08 +00:00
listActionsProps,
pageListProps,
searchPageProps,
2020-01-02 12:22:12 +00:00
sortPageProps,
tabPageProps,
} from "@dashboard/fixtures";
2023-01-05 12:34:34 +00:00
import React from "react";
import { PaginatorContextDecorator } from "../../../../.storybook/decorators";
import { MockedUserProvider } from "../../../../.storybook/helpers";
2023-01-05 12:34:34 +00:00
import { customerList } from "../../fixtures";
import { CustomerListUrlSortField } from "../../urls";
import CustomerListPageComponent, {
CustomerListPageProps,
} from "./CustomerListPage";
2019-06-19 14:40:52 +00:00
const props: CustomerListPageProps = {
2020-01-02 12:22:12 +00:00
...filterPageProps,
2019-06-19 14:40:52 +00:00
...listActionsProps,
...pageListProps.default,
2019-09-12 13:31:08 +00:00
...searchPageProps,
2019-12-17 17:13:56 +00:00
...sortPageProps,
2019-09-12 13:31:08 +00:00
...tabPageProps,
2019-12-17 17:13:56 +00:00
customers: customerList,
selectedCustomerIds: ["123"],
2020-01-02 12:22:12 +00:00
filterOpts: {
joined: {
active: false,
value: {
max: undefined,
min: undefined,
},
2020-01-02 12:22:12 +00:00
},
numberOfOrders: {
active: false,
value: {
max: undefined,
min: undefined,
},
},
2020-01-02 12:22:12 +00:00
},
2019-12-17 17:13:56 +00:00
sort: {
...sortPageProps.sort,
sort: CustomerListUrlSortField.name,
},
2019-06-19 14:40:52 +00:00
};
const CustomerListPage = props => (
<MockedUserProvider>
<CustomerListPageComponent {...props} />
</MockedUserProvider>
);
export default {
title: "Customers / Customer list",
decorators: [PaginatorContextDecorator],
};
export const Default = () => <CustomerListPage {...props} />;
export const Loading = () => (
<CustomerListPage {...props} disabled={true} customers={undefined} />
);
export const NoData = () => <CustomerListPage {...props} customers={[]} />;