Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add storybook for home page
Lukasz Szewczyk83b4a586bcc1
diff --git a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx b/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsxindex 362344ed94..aae99fd007 100644--- a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx+++ b/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx@@ -6,10 +6,6 @@ import CardSpacer from "../../../components/CardSpacer";import Container from "../../../components/Container";import PageHeader from "../../../components/PageHeader";import i18n from "../../../i18n";-interface MoneyType {- amount: number;- currency: string;-}export interface DashboardProps {ownerName: string;diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.jsindex 68aaa6cdcb..496295b3f6 100644--- a/saleor/static/dashboard-next/storybook/config.js+++ b/saleor/static/dashboard-next/storybook/config.js@@ -99,6 +99,9 @@ function loadStories() {// Site settingsrequire("./stories/siteSettings/SiteSettingsKeyDialog");require("./stories/siteSettings/SiteSettingsPage");++ // Homepage+ require("./stories/home/dashboard");}configure(loadStories, module);diff --git a/saleor/static/dashboard-next/storybook/stories/home/dashboard.tsx b/saleor/static/dashboard-next/storybook/stories/home/dashboard.tsxnew file mode 100644index 0000000000..54b6b5ab9d--- /dev/null+++ b/saleor/static/dashboard-next/storybook/stories/home/dashboard.tsx@@ -0,0 +1,18 @@+import { storiesOf } from "@storybook/react";+import * as React from "react";+import * as placeholderImage from "../../../../images/placeholder60x60.png";+import Dashbaord, { DashboardProps } from "../../../home/components/Dashbaord";+import { shop as shopFixture } from "../../../home/fixtures";+import Decorator from "../../Decorator";++const shop = shopFixture(placeholderImage);++const dashboardProps: DashboardProps = {+ ownerName: shop.ownerName+};++storiesOf("Views / Home / Dashboard", module)+ .addDecorator(Decorator)+ .add("default", () => <Dashbaord {...dashboardProps} />)+ .add("loading", () => <Dashbaord {...dashboardProps} />)+ .add("no data", () => <Dashbaord {...dashboardProps} />);