2019-06-19 14:40:52 +00:00
|
|
|
import Card from "@material-ui/core/Card";
|
|
|
|
import CardContent from "@material-ui/core/CardContent";
|
2020-05-14 09:30:32 +00:00
|
|
|
import AddressEdit from "@saleor/components/AddressEdit";
|
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
|
|
|
|
|
|
|
import { customer } from "../../../customers/fixtures";
|
|
|
|
import { transformAddressToForm } from "../../../misc";
|
|
|
|
import { countries } from "../../../orders/fixtures";
|
|
|
|
import Decorator from "../../Decorator";
|
|
|
|
|
|
|
|
storiesOf("Generics / AddressEdit", module)
|
|
|
|
.addDecorator(Decorator)
|
|
|
|
.add("default", () => (
|
|
|
|
<Card
|
|
|
|
style={{
|
|
|
|
margin: "auto",
|
|
|
|
width: 768
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<CardContent>
|
|
|
|
<AddressEdit
|
2020-02-24 14:14:48 +00:00
|
|
|
errors={[]}
|
2019-06-19 14:40:52 +00:00
|
|
|
data={transformAddressToForm(customer.defaultBillingAddress)}
|
2019-08-09 11:14:35 +00:00
|
|
|
countries={countries.map(c => ({
|
|
|
|
label: c.label,
|
|
|
|
value: c.code
|
|
|
|
}))}
|
|
|
|
countryDisplayValue={customer.defaultBillingAddress.country.country}
|
2019-06-19 14:40:52 +00:00
|
|
|
onChange={undefined}
|
2019-08-09 11:14:35 +00:00
|
|
|
onCountryChange={() => undefined}
|
2019-06-19 14:40:52 +00:00
|
|
|
/>
|
|
|
|
</CardContent>
|
|
|
|
</Card>
|
|
|
|
));
|