Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add customer details page

dominik-zeglen54b0ebf8a36b
diff --git a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
index bc2cc9277c..dd40a2aeaf 100644
--- a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
+++ b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
@@ -1,8 +1,10 @@
import { withStyles } from "@material-ui/core/styles";
import Typography from "@material-ui/core/Typography";
+import * as classNames from "classnames";
import * as React from "react";
interface CardTitleProps extends React.StatelessComponent {
+ className?: string;
title: string | React.ReactNode;
toolbar?: React.ReactNode;
onClick?: (event: React.MouseEvent<any>) => void;
@@ -33,9 +35,9 @@ const decorate = withStyles(theme => ({
}
}));
const CardTitle = decorate<CardTitleProps>(
- ({ classes, children, title, toolbar, onClick, ...props }) => (
+ ({ classes, className, children, title, toolbar, onClick, ...props }) => (
<>
- <div className={classes.root} {...props}>
+ <div className={classNames(classes.root, className)} {...props}>
<Typography
className={classes.title}
variant="body1"
diff --git a/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx b/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx
new file mode 100644
index 0000000000..e22484edda
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerAddresses/CustomerAddresses.tsx
@@ -0,0 +1,83 @@
+import Button from "@material-ui/core/Button";
+import Card from "@material-ui/core/Card";
+import CardContent from "@material-ui/core/CardContent";
+import { withStyles } from "@material-ui/core/styles";
+import Typography from "@material-ui/core/Typography";
+import * as React from "react";
+
+import AddressFormatter from "../../../components/AddressFormatter/AddressFormatter";
+import CardTitle from "../../../components/CardTitle";
+import { Hr } from "../../../components/Hr";
+import i18n from "../../../i18n";
+import { maybe } from "../../../misc";
+import { CustomerDetails_user } from "../../types/CustomerDetails";
+
+export interface CustomerAddressesProps {
+ customer: CustomerDetails_user;
+ disabled: boolean;
+ onAddressManageClick: () => void;
+}
+
+const decorate = withStyles(theme => ({
+ label: {
+ fontWeight: 600 as 600,
+ marginBottom: theme.spacing.unit
+ }
+}));
+const CustomerAddresses = decorate<CustomerAddressesProps>(
+ ({ classes, customer, disabled, onAddressManageClick }) => (
+ <Card>
+ <CardTitle
+ title={i18n.t("Address Information")}
+ toolbar={
+ <Button
+ color="secondary"
+ disabled={disabled}
+ variant="flat"
+ onClick={onAddressManageClick}
+ >
+ {i18n.t("Manage", { context: "button" })}
+ </Button>
+ }
+ />
+ {customer &&
+ customer.defaultBillingAddress &&
+ customer.defaultBillingAddress.id &&
+ customer.defaultShippingAddress &&
+ customer.defaultShippingAddress.id &&
+ customer.defaultBillingAddress.id !==
+ customer.defaultShippingAddress.id ? (
+ <>
+ <CardContent>
+ <Typography className={classes.label}>
+ {i18n.t("Default shipping address")}
+ </Typography>
+ <AddressFormatter
+ address={maybe(() => customer.defaultBillingAddress)}
+ />
+ </CardContent>
+ <Hr />
+ <CardContent>
+ <Typography className={classes.label}>
+ {i18n.t("Default shipping address")}
+ </Typography>
+ <AddressFormatter
+ address={maybe(() => customer.defaultShippingAddress)}
+ />
+ </CardContent>
+ </>
+ ) : (
+ <CardContent>
+ <Typography className={classes.label}>
+ {i18n.t("Default address")}
+ </Typography>
+ <AddressFormatter
+ address={maybe(() => customer.defaultBillingAddress)}
+ />
+ </CardContent>
+ )}
+ </Card>
+ )
+);
+CustomerAddresses.displayName = "CustomerAddresses";
+export default CustomerAddresses;
diff --git a/saleor/static/dashboard-next/customers/components/CustomerAddresses/index.ts b/saleor/static/dashboard-next/customers/components/CustomerAddresses/index.ts
new file mode 100644
index 0000000000..f26348a2c5
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerAddresses/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./CustomerAddresses";
+export * from "./CustomerAddresses";
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
new file mode 100644
index 0000000000..19788bd5fb
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetails/CustomerDetails.tsx
@@ -0,0 +1,99 @@
+import Card from "@material-ui/core/Card";
+import CardContent from "@material-ui/core/CardContent";
+import { withStyles } from "@material-ui/core/styles";
+import TextField from "@material-ui/core/TextField";
+import Typography from "@material-ui/core/Typography";
+import * as moment from "moment-timezone";
+import * as React from "react";
+
+import CardTitle from "../../../components/CardTitle";
+import { FormSpacer } from "../../../components/FormSpacer";
+import i18n from "../../../i18n";
+import { CustomerDetails_user } from "../../types/CustomerDetails";
+import { ControlledCheckbox } from "../../../components/ControlledCheckbox";
+import { maybe } from "../../../misc";
+
+export interface CustomerDetailsProps {
+ customer: CustomerDetails_user;
+ data: {
+ email: string;
+ isActive: boolean;
+ note: string;
+ };
+ disabled: boolean;
+ errors: {
+ email?: string;
+ note?: string;
+ };
+ onChange: (event: React.ChangeEvent<any>) => void;
+}
+
+const decorate = withStyles(theme => ({
+ cardTitle: {
+ height: 64
+ },
+ root: {
+ display: "grid" as "grid",
+ gridColumnGap: theme.spacing.unit * 2 + "px",
+ gridTemplateColumns: "1fr 1fr"
+ }
+}));
+const CustomerDetails = decorate<CustomerDetailsProps>(
+ ({ classes, customer, data, disabled, errors, onChange }) => (
+ <Card>
+ <CardTitle
+ className={classes.cardTitle}
+ title={
+ <>
+ {i18n.t("General Information")}
+ <Typography variant="caption">
+ {i18n.t("Customer since: {{ month }} {{ year }}", {
+ month: moment(maybe(() => customer.dateJoined)).format("MMM"),
+ year: moment(maybe(() => customer.dateJoined)).format("YYYY")
+ })}
+ </Typography>
+ </>
+ }
+ />
+ <CardContent>
+ <ControlledCheckbox
+ checked={data.isActive}
+ disabled={disabled}
+ label={i18n.t("User account active", {
+ context: "label"
+ })}
+ name="isActive"
+ onChange={onChange}
+ />
+ <FormSpacer />
+ <div className={classes.root}>
+ <TextField
+ disabled={disabled}
+ error={!!errors.email}
+ fullWidth
+ helperText={errors.email}
+ name="email"
+ type="email"
+ label={i18n.t("E-mail")}
+ value={data.email}
+ onChange={onChange}
+ />
+ </div>
+ <FormSpacer />
+ <TextField
+ disabled={disabled}
+ error={!!errors.note}
+ fullWidth
+ multiline
+ helperText={errors.note}
+ name="note"
+ label={i18n.t("Note")}
+ value={data.note}
+ onChange={onChange}
+ />
+ </CardContent>
+ </Card>
+ )
+);
+CustomerDetails.displayName = "CustomerDetails";
+export default CustomerDetails;
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetails/index.ts b/saleor/static/dashboard-next/customers/components/CustomerDetails/index.ts
new file mode 100644
index 0000000000..0c9569a115
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetails/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./CustomerDetails";
+export * from "./CustomerDetails";
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx b/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx
new file mode 100644
index 0000000000..b805ca3ce4
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx
@@ -0,0 +1,101 @@
+import { withStyles } from "@material-ui/core/styles";
+import * as React from "react";
+
+import { CardSpacer } from "../../../components/CardSpacer";
+import Container from "../../../components/Container";
+import Form from "../../../components/Form";
+import PageHeader from "../../../components/PageHeader";
+import SaveButtonBar from "../../../components/SaveButtonBar";
+import { maybe } from "../../../misc";
+import { CustomerDetails_user } from "../../types/CustomerDetails";
+import CustomerDetails from "../CustomerDetails/CustomerDetails";
+import CustomerOrders from "../CustomerOrders/CustomerOrders";
+import CustomerAddresses from "../CustomerAddresses/CustomerAddresses";
+import CustomerStats from "../CustomerStats/CustomerStats";
+
+export interface CustomerDetailsPageFormData {
+ email: string;
+ isActive: boolean;
+ note: string;
+}
+
+export interface CustomerDetailsPageProps {
+ customer: CustomerDetails_user;
+ disabled: boolean;
+ onBack: () => void;
+ onSubmit: (data: CustomerDetails_user) => void;
+ onViewAllOrdersClick: () => void;
+ onRowClick: (id: string) => void;
+ onAddressManageClick: () => void;
+}
+
+const decorate = withStyles(theme => ({
+ root: {
+ display: "grid" as "grid",
+ gridColumnGap: theme.spacing.unit * 3 + "px",
+ gridTemplateColumns: "9fr 4fr"
+ }
+}));
+const CustomerDetailsPage = decorate<CustomerDetailsPageProps>(
+ ({
+ classes,
+ customer,
+ disabled,
+ onBack,
+ onSubmit,
+ onViewAllOrdersClick,
+ onRowClick,
+ onAddressManageClick
+ }) => (
+ <Form
+ initial={{
+ email: maybe(() => customer.email),
+ isActive: maybe(() => customer.isActive),
+ note: maybe(() => customer.note)
+ }}
+ key={JSON.stringify(customer)}
+ onSubmit={onSubmit}
+ >
+ {({ change, data, errors: formErrors, hasChanged, submit }) => (
+ <Container width="md">
+ <PageHeader onBack={onBack} title={maybe(() => customer.email)} />
+ <div className={classes.root}>
+ <div>
+ <CustomerDetails
+ customer={customer}
+ data={data}
+ disabled={disabled}
+ errors={formErrors}
+ onChange={change}
+ />
+ <CardSpacer />
+ <CustomerOrders
+ orders={maybe(() =>
+ customer.orders.edges.map(edge => edge.node)
+ )}
+ onViewAllOrdersClick={onViewAllOrdersClick}
+ onRowClick={onRowClick}
+ />
+ </div>
+ <div>
+ <CustomerAddresses
+ customer={customer}
+ disabled={disabled}
+ onAddressManageClick={onAddressManageClick}
+ />
+ <CardSpacer />
+ <CustomerStats customer={customer} />
+ </div>
+ </div>
+ <SaveButtonBar
+ disabled={disabled || !hasChanged}
+ onSave={submit}
+ onCancel={onBack}
+ />
+ </Container>
+ )}
+ </Form>
+ )
+);
+CustomerDetailsPage.displayName = "CustomerDetailsPage";
+export default CustomerDetailsPage;
diff --git a/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/index.ts b/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/index.ts
new file mode 100644
index 0000000000..7625dc8725
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerDetailsPage/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./CustomerDetailsPage";
+export * from "./CustomerDetailsPage";
diff --git a/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx b/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx
new file mode 100644
index 0000000000..1361c64ae2
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerOrders/CustomerOrders.tsx
@@ -0,0 +1,135 @@
+import Button from "@material-ui/core/Button";
+import Card from "@material-ui/core/Card";
+import { withStyles } from "@material-ui/core/styles";
+import Table from "@material-ui/core/Table";
+import TableBody from "@material-ui/core/TableBody";
+import TableCell from "@material-ui/core/TableCell";
+import TableHead from "@material-ui/core/TableHead";
+import TableRow from "@material-ui/core/TableRow";
+import * as React from "react";
+
+import CardTitle from "../../../components/CardTitle";
+import DateFormatter from "../../../components/DateFormatter";
+import Money from "../../../components/Money";
+import Skeleton from "../../../components/Skeleton";
+import StatusLabel from "../../../components/StatusLabel";
+import i18n from "../../../i18n";
+import { maybe, renderCollection } from "../../../misc";
+import { transformPaymentStatus } from "../../../orders";
+import { CustomerDetails_user_orders_edges_node } from "../../types/CustomerDetails";
+
+export interface CustomerOrdersProps {
+ orders: CustomerDetails_user_orders_edges_node[];
+ onViewAllOrdersClick: () => void;
+ onRowClick: (id: string) => void;
+}
+
+const decorate = withStyles({
+ link: {
+ cursor: "pointer"
+ },
+ textRight: {
+ textAlign: "right" as "right"
+ }
+});
+const CustomerOrders = decorate<CustomerOrdersProps>(
+ ({ classes, orders, onRowClick, onViewAllOrdersClick }) => {
+ const orderList = orders
+ ? orders.map(order => ({
+ ...order,
+ paymentStatus: transformPaymentStatus(order.paymentStatus)
+ }))
+ : undefined;
+ return (
+ <Card>
+ <CardTitle
+ title={i18n.t("Recent orders")}
+ toolbar={
+ <Button
+ variant="flat"
+ color="secondary"
+ onClick={onViewAllOrdersClick}
+ >
+ {i18n.t("View all orders")}
+ </Button>
+ }
+ />
+ <Table>
+ <TableHead>
+ <TableRow>
+ <TableCell padding="dense">
+ {i18n.t("No. of Order", { context: "table header" })}
+ </TableCell>
+ <TableCell padding="dense">
+ {i18n.t("Date", { context: "table header" })}
+ </TableCell>
+ <TableCell padding="dense">
+ {i18n.t("Status", { context: "table header" })}
+ </TableCell>
+ <TableCell className={classes.textRight} padding="dense">
+ {i18n.t("Total", { context: "table header" })}
+ </TableCell>
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {renderCollection(
+ orderList,
+ order => (
+ <TableRow
+ hover={!!order}
+ className={!!order ? classes.link : undefined}
+ onClick={order ? () => onRowClick(order.id) : undefined}
+ key={order ? order.id : "skeleton"}
+ >
+ <TableCell padding="dense">
+ {maybe(() => order.number) ? (
+ "#" + order.number
+ ) : (
+ <Skeleton />
+ )}
+ </TableCell>
+ <TableCell padding="dense">
+ {maybe(() => order.created) ? (
+ <DateFormatter date={order.created} />
+ ) : (
+ <Skeleton />
+ )}
+ </TableCell>
+ <TableCell padding="dense">
+ {maybe(() => order.paymentStatus.status) !== undefined ? (
+ order.paymentStatus.status === null ? null : (
+ <StatusLabel
+ status={order.paymentStatus.status}
+ label={order.paymentStatus.localized}
+ />
+ )
+ ) : (
+ <Skeleton />
+ )}
+ </TableCell>
+ <TableCell className={classes.textRight} padding="dense">
+ {maybe(() => order.total.gross) ? (
+ <Money
+ amount={order.total.gross.amount}
+ currency={order.total.gross.currency}
+ />
+ ) : (
+ <Skeleton />
+ )}
+ </TableCell>
+ </TableRow>
+ ),
+ () => (
+ <TableRow>
+ <TableCell colSpan={6}>{i18n.t("No orders found")}</TableCell>
+ </TableRow>
+ )
+ )}
+ </TableBody>
+ </Table>
+ </Card>
+ );
+ }
+);
+CustomerOrders.displayName = "CustomerOrders";
+export default CustomerOrders;
diff --git a/saleor/static/dashboard-next/customers/components/CustomerOrders/index.ts b/saleor/static/dashboard-next/customers/components/CustomerOrders/index.ts
new file mode 100644
index 0000000000..8a3fbc5332
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerOrders/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./CustomerOrders";
+export * from "./CustomerOrders";
diff --git a/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx b/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx
new file mode 100644
index 0000000000..978eddcc77
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerStats/CustomerStats.tsx
@@ -0,0 +1,55 @@
+import Card from "@material-ui/core/Card";
+import CardContent from "@material-ui/core/CardContent";
+import { withStyles } from "@material-ui/core/styles";
+import Typography from "@material-ui/core/Typography";
+import * as React from "react";
+
+import CardTitle from "../../../components/CardTitle";
+import DateFormatter from "../../../components/DateFormatter";
+import { Hr } from "../../../components/Hr";
+import Skeleton from "../../../components/Skeleton";
+import i18n from "../../../i18n";
+import { maybe } from "../../../misc";
+import { CustomerDetails_user } from "../../types/CustomerDetails";
+
+export interface CustomerStatsProps {
+ customer: CustomerDetails_user;
+}
+
+const decorate = withStyles({
+ value: {
+ fontSize: 24
+ }
+});
+const CustomerStats = decorate<CustomerStatsProps>(({ classes, customer }) => (
+ <Card>
+ <CardTitle title={i18n.t("Customer History")} />
+ <CardContent>
+ <Typography variant="body2">{i18n.t("Last login")}</Typography>
+ {maybe(
+ () => (
+ <Typography variant="title" className={classes.value}>
+ <DateFormatter date={customer.lastLogin} />
+ </Typography>
+ ),
+ <Skeleton />
+ )}
+ </CardContent>
+ <Hr />
+ <CardContent>
+ <Typography variant="body2">{i18n.t("Last order")}</Typography>
+ {maybe(
+ () => (
+ <Typography variant="title" className={classes.value}>
+ <DateFormatter
+ date={customer.lastPlacedOrder.edges[0].node.created}
+ />
+ </Typography>
+ ),
+ <Skeleton />
+ )}
+ </CardContent>
+ </Card>
+));
+CustomerStats.displayName = "CustomerStats";
+export default CustomerStats;
diff --git a/saleor/static/dashboard-next/customers/components/CustomerStats/index.ts b/saleor/static/dashboard-next/customers/components/CustomerStats/index.ts
new file mode 100644
index 0000000000..f34d3e1cc1
--- /dev/null
+++ b/saleor/static/dashboard-next/customers/components/CustomerStats/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./CustomerStats";
+export * from "./CustomerStats";
diff --git a/saleor/static/dashboard-next/customers/fixtures.ts b/saleor/static/dashboard-next/customers/fixtures.ts
index 4cee15b2d5..5906db6f7b 100644
--- a/saleor/static/dashboard-next/customers/fixtures.ts
+++ b/saleor/static/dashboard-next/customers/fixtures.ts
@@ -897,6 +897,7 @@ export const customerList: ListCustomers_customers_edges_node[] = [
];
export const customer: CustomerDetails_user = {
__typename: "User",
+ dateJoined: "2017-05-07T09:37:30.124154+00:00",
defaultBillingAddress: {
__typename: "Address",
city: "Port Danielshire",
@@ -938,6 +939,7 @@ export const customer: CustomerDetails_user = {
id: "VXNlcjoy",
isActive: true,
+ lastLogin: "2018-05-07T09:37:30.124154+00:00",
lastPlacedOrder: {
__typename: "OrderCountableConnection",
edges: [
@@ -945,7 +947,7 @@ export const customer: CustomerDetails_user = {
__typename: "OrderCountableEdge",
node: {
__typename: "Order",
- created: "2018-09-11T09:37:30.124154+00:00",
+ created: "2018-05-07T09:37:30.124154+00:00",
id: "T3JkZXI6MTk="
}
}
@@ -959,8 +961,9 @@ export const customer: CustomerDetails_user = {
__typename: "OrderCountableEdge",
node: {
__typename: "Order",
- created: "2018-09-11T09:37:30.124154+00:00",
+ created: "2018-05-07T09:37:30.124154+00:00",
id: "T3JkZXI6MTk=",
+ number: "8234",
paymentStatus: PaymentStatusEnum.CONFIRMED,
total: {
__typename: "TaxedMoney",
diff --git a/saleor/static/dashboard-next/customers/queries.ts b/saleor/static/dashboard-next/customers/queries.ts
index 1e380f0eae..ebc84106f0 100644
--- a/saleor/static/dashboard-next/customers/queries.ts
+++ b/saleor/static/dashboard-next/customers/queries.ts
@@ -45,6 +45,8 @@ const customerDetails = gql`
user(id: $id) {
id
email
+ dateJoined
+ lastLogin
defaultShippingAddress {
...AddressFragment
}
@@ -58,6 +60,7 @@ const customerDetails = gql`
node {
id
created
+ number
paymentStatus
total {
gross {
diff --git a/saleor/static/dashboard-next/customers/types/CustomerDetails.ts b/saleor/static/dashboard-next/customers/types/CustomerDetails.ts
index ce974cc798..6d90f8629c 100644
--- a/saleor/static/dashboard-next/customers/types/CustomerDetails.ts
+++ b/saleor/static/dashboard-next/customers/types/CustomerDetails.ts
@@ -66,6 +66,7 @@ export interface CustomerDetails_user_orders_edges_node {
__typename: "Order";
id: string;
created: any;
+ number: string | null;
paymentStatus: PaymentStatusEnum | null;
total: CustomerDetails_user_orders_edges_node_total | null;
}
@@ -100,6 +101,8 @@ export interface CustomerDetails_user {
__typename: "User";
id: string;
email: string;
+ dateJoined: any;
+ lastLogin: any | null;
defaultShippingAddress: CustomerDetails_user_defaultShippingAddress | null;
defaultBillingAddress: CustomerDetails_user_defaultBillingAddress | null;
note: string | null;
diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.js
index 9733df22aa..62e82cc64a 100644
--- a/saleor/static/dashboard-next/storybook/config.js
+++ b/saleor/static/dashboard-next/storybook/config.js
@@ -47,7 +47,7 @@ function loadStories() {
require("./stories/configuration/ConfigurationPage");
// Customers
- // require("./stories/customers/CustomerDetailsPage");
+ require("./stories/customers/CustomerDetailsPage");
require("./stories/customers/CustomerListPage");
// Homepage
diff --git a/saleor/static/dashboard-next/storybook/stories/customers/CustomerDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/customers/CustomerDetailsPage.tsx
new file mode 100644
index 0000000000..14afd3adf9
--- /dev/null
+++ b/saleor/static/dashboard-next/storybook/stories/customers/CustomerDetailsPage.tsx
@@ -0,0 +1,25 @@
+import { storiesOf } from "@storybook/react";
+import * as React from "react";
+
+import CustomerDetailsPage, {
+ CustomerDetailsPageProps
+} from "../../../customers/components/CustomerDetailsPage";
+import { customer } from "../../../customers/fixtures";
+import Decorator from "../../Decorator";
+
+const props: CustomerDetailsPageProps = {
+ customer,
+ disabled: false,
+ onAddressManageClick: () => undefined,
+ onBack: () => undefined,
+ onRowClick: () => undefined,
+ onSubmit: () => undefined,
+ onViewAllOrdersClick: () => undefined
+};
+
+storiesOf("Views / Customers / Customer details", module)
+ .addDecorator(Decorator)
+ .add("default", () => <CustomerDetailsPage {...props} />)
+ .add("loading", () => (
+ <CustomerDetailsPage {...props} customer={undefined} disabled={true} />
+ ));