saleor-dashboard/src/staff/components/StaffListPage/StaffListPage.stories.tsx

51 lines
1.3 KiB
TypeScript
Raw Normal View History

2019-09-12 13:31:08 +00:00
import {
filterPageProps,
limits,
limitsReached,
2019-09-12 13:31:08 +00:00
pageListProps,
searchPageProps,
2020-01-07 12:06:11 +00:00
sortPageProps,
tabPageProps
} from "@saleor/fixtures";
import { staffMembers } from "@saleor/staff/fixtures";
import { StaffListUrlSortField } from "@saleor/staff/urls";
import Decorator from "@saleor/storybook/Decorator";
import { StaffMemberStatus } from "@saleor/types/globalTypes";
import { storiesOf } from "@storybook/react";
import React from "react";
import StaffListPage, { StaffListPageProps } from ".";
2019-06-19 14:40:52 +00:00
const props: StaffListPageProps = {
2019-09-12 13:31:08 +00:00
...pageListProps.default,
...searchPageProps,
2019-12-17 17:13:56 +00:00
...sortPageProps,
2019-09-12 13:31:08 +00:00
...tabPageProps,
2020-01-07 12:06:11 +00:00
...filterPageProps,
filterOpts: {
status: {
active: false,
value: StaffMemberStatus.ACTIVE
}
},
limits,
2019-06-19 14:40:52 +00:00
onAdd: undefined,
onBack: () => undefined,
2019-12-17 17:13:56 +00:00
sort: {
...sortPageProps.sort,
sort: StaffListUrlSortField.name
},
2019-09-12 13:31:08 +00:00
staffMembers
2019-06-19 14:40:52 +00:00
};
storiesOf("Views / Staff / Staff members", module)
.addDecorator(Decorator)
.add("default", () => <StaffListPage {...props} />)
.add("when loading", () => (
<StaffListPage {...props} disabled={true} staffMembers={undefined} />
))
.add("no limits", () => <StaffListPage {...props} limits={undefined} />)
.add("limits reached", () => (
<StaffListPage {...props} limits={limitsReached} />
2019-06-19 14:40:52 +00:00
));