Skip to content

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

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.tsx
index 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.js
index 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 settings
require("./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.tsx
new file mode 100644
index 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} />);