saleor-dashboard/src/channels/components/ShippingZones/ShippingZones.stories.tsx
Dawid e610aefcfa
Add allocation strategies with sortable warehouses (#2258)
* Add allocation strategy options in channel view

* Update schema with channel allocation strategy

* Reorder channel warehouses after channel saving

* Refactor and clean code of allocation strategy options

* Update schema with allocation strategy

* Trigger CI

* Update allocation starategy options UI

* Update allocation strategy messages

* Trigger CI

* Fix shipping zones and warehouses cards style

* Fix message

* Fix snapshots

Co-authored-by: Michał Droń <dron.official@yahoo.com>
2022-08-29 13:35:55 +02:00

46 lines
1.2 KiB
TypeScript

import { ChannelShippingZones } from "@saleor/channels/pages/ChannelDetailsPage/types";
import CommonDecorator from "@saleor/storybook/Decorator";
import { storiesOf } from "@storybook/react";
import React from "react";
import ShippingZones, { ShippingZonesProps } from "./ShippingZones";
const shippingZones = [
{
__typename: "ShippingZone",
id: "2",
name: "Fancy shipping zone",
},
{
__typename: "ShippingZone",
id: "3",
name: "Nice shipping zone",
},
];
const baseProps: ShippingZonesProps = {
addShippingZone: () => undefined,
removeShippingZone: () => undefined,
searchShippingZones: () => undefined,
fetchMoreShippingZones: {
loading: false,
hasMore: false,
onFetchMore: () => undefined,
totalCount: 0,
},
shippingZones: [],
shippingZonesChoices: shippingZones as ChannelShippingZones,
totalCount: 10,
loading: false,
};
storiesOf("Shipping zones", module)
.addDecorator(CommonDecorator)
.add("with no options selected", () => <ShippingZones {...baseProps} />)
.add("with options selected", () => (
<ShippingZones
{...baseProps}
shippingZones={shippingZones as ChannelShippingZones}
/>
))
.add("loading", () => <ShippingZones {...baseProps} loading={true} />);