Skip to content

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

Rename Dashboad to HomePage

Lukasz Szewczykfdd20f701113
diff --git a/saleor/static/dashboard-next/home/components/Dashbaord/index.ts b/saleor/static/dashboard-next/home/components/Dashbaord/index.ts
deleted file mode 100644
index 27e698def7..0000000000
--- a/saleor/static/dashboard-next/home/components/Dashbaord/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default } from "./Dashbaord";
-export * from "./Dashbaord";
diff --git a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx b/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
similarity index 96%
rename from saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx
rename to saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
index b8f029d8c9..8e4b0268ae 100644
--- a/saleor/static/dashboard-next/home/components/Dashbaord/Dashbaord.tsx
+++ b/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
@@ -15,7 +15,7 @@ interface MoneyType {
amount: number;
currency: string;
}
-export interface DashboardProps {
+export interface HomePageProps {
activities?: Array<{
action: string;
admin: boolean;
@@ -68,7 +68,7 @@ const decorate = withStyles(theme => ({
}
}
}));
-const Dashboard = decorate<DashboardProps>(
+const HomePage = decorate<HomePageProps>(
({ userName, classes, daily, topProducts, onRowClick, activities }) => {
return (
<Container width="md">
@@ -113,4 +113,4 @@ const Dashboard = decorate<DashboardProps>(
);
}
);
-export default Dashboard;
+export default HomePage;
diff --git a/saleor/static/dashboard-next/home/components/HomePage/index.ts b/saleor/static/dashboard-next/home/components/HomePage/index.ts
new file mode 100644
index 0000000000..60f729a6cf
--- /dev/null
+++ b/saleor/static/dashboard-next/home/components/HomePage/index.ts
@@ -0,0 +1,2 @@
+export { default } from "./HomePage";
+export * from "./HomePage";
diff --git a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductList.tsx b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductList.tsx
index 58762ee3b1..1fcfddac6e 100644
--- a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductList.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductList.tsx
@@ -35,7 +35,7 @@ const decorate = withStyles(theme => ({
height: "64px",
width: "64px"
},
- tableRowPointer: {
+ tableRow: {
cursor: "pointer" as "pointer"
},
tableRowSize: {
@@ -55,7 +55,7 @@ export const HomeProductList = decorate<HomeProductListProps>(
key={product ? product.id : "skeleton"}
hover={!!product}
className={classNames({
- [classes.tableRowPointer]: !!product
+ [classes.tableRow]: !!product
})}
onClick={!!product ? onRowClick(product.id) : undefined}
>
diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.js
index 496295b3f6..ff80d3d1b1 100644
--- a/saleor/static/dashboard-next/storybook/config.js
+++ b/saleor/static/dashboard-next/storybook/config.js
@@ -50,6 +50,9 @@ function loadStories() {
require("./stories/customers/CustomerEditPage");
require("./stories/customers/CustomerListPage");
+ // Homepage
+ require("./stories/home/HomePage");
+
// Staff
require("./stories/staff/StaffListPage");
require("./stories/staff/StaffDetailsPage");
@@ -99,9 +102,6 @@ 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/HomePage.tsx
similarity index 66%
rename from saleor/static/dashboard-next/storybook/stories/home/dashboard.tsx
rename to saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx
index 4c94a15116..782d03ca5e 100644
--- a/saleor/static/dashboard-next/storybook/stories/home/dashboard.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx
@@ -1,13 +1,13 @@
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 HomePage, { HomePageProps } from "../../../home/components/HomePage";
import { shop as shopFixture } from "../../../home/fixtures";
import Decorator from "../../Decorator";
const shop = shopFixture(placeholderImage);
-const dashboardProps: DashboardProps = {
+const HomePageProps: HomePageProps = {
activities: shop.activities,
daily: shop.daily,
onRowClick: () => undefined,
@@ -15,12 +15,12 @@ const dashboardProps: DashboardProps = {
userName: shop.userName
};
-storiesOf("Views / Home / Dashboard", module)
+storiesOf("Views / HomePage", module)
.addDecorator(Decorator)
- .add("default", () => <Dashbaord {...dashboardProps} />)
+ .add("default", () => <HomePage {...HomePageProps} />)
.add("loading", () => (
- <Dashbaord
- {...dashboardProps}
+ <HomePage
+ {...HomePageProps}
topProducts={undefined}
daily={undefined}
activities={undefined}
@@ -28,5 +28,5 @@ storiesOf("Views / Home / Dashboard", module)
/>
))
.add("no data", () => (
- <Dashbaord {...dashboardProps} topProducts={[]} activities={[]} />
+ <HomePage {...HomePageProps} topProducts={[]} activities={[]} />
));