Skip to content

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

Fix HomePage props

Lukasz Szewczyk3b6d71869038
diff --git a/saleor/static/dashboard-next/home/components/HomeActivityCard/HomeActivityCard.tsx b/saleor/static/dashboard-next/home/components/HomeActivityCard/HomeActivityCard.tsx
index 9046041389..22018d6a55 100644
--- a/saleor/static/dashboard-next/home/components/HomeActivityCard/HomeActivityCard.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeActivityCard/HomeActivityCard.tsx
@@ -22,7 +22,6 @@ interface HomeProductListCardProps {
newElement: string;
user: string;
}>;
- disabled: boolean;
}
const decorate = withStyles({
diff --git a/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx b/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
index 73d505949b..de13ee4e87 100644
--- a/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
+++ b/saleor/static/dashboard-next/home/components/HomePage/HomePage.tsx
@@ -31,7 +31,6 @@ export interface HomePageProps {
};
sales: MoneyType;
};
- onRowClick: () => undefined;
userName: string;
topProducts: Array<{
id: string;
@@ -41,6 +40,7 @@ export interface HomePageProps {
thumbnailUrl: string;
variant: string;
}>;
+ onProductClick?(id: string): () => void;
}
const decorate = withStyles(theme => ({
@@ -69,7 +69,7 @@ const decorate = withStyles(theme => ({
}
}));
const HomePage = decorate<HomePageProps>(
- ({ userName, classes, daily, topProducts, onRowClick, activities }) => {
+ ({ userName, classes, daily, topProducts, onProductClick, activities }) => {
return (
<Container width="md">
<HomeHeader userName={userName} />
@@ -99,14 +99,13 @@ const HomePage = decorate<HomePageProps>(
</div>
<HomeProductListCard
- onRowClick={onRowClick}
- disabled={false}
+ onRowClick={onProductClick}
topProducts={topProducts}
/>
<CardSpacer />
</div>
<div>
- <HomeActivityCard disabled={false} activities={activities} />
+ <HomeActivityCard activities={activities} />
</div>
</div>
</Container>
diff --git a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
index c837f44aa7..44194ef45a 100644
--- a/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
+++ b/saleor/static/dashboard-next/home/components/HomeProductListCard/HomeProductListCard.tsx
@@ -29,7 +29,6 @@ interface HomeProductListProps {
variant: string;
}>;
onRowClick: (id: string) => () => void;
- disabled: boolean;
}
const decorate = withStyles(theme => ({
diff --git a/saleor/static/dashboard-next/home/fixtures.ts b/saleor/static/dashboard-next/home/fixtures.ts
index cfed1fadd9..ae74fa0a28 100644
--- a/saleor/static/dashboard-next/home/fixtures.ts
+++ b/saleor/static/dashboard-next/home/fixtures.ts
@@ -55,7 +55,7 @@ export const shop: (placeholderImage: string) => HomePageProps = (
problems: 69,
productsOut: 2
},
- onRowClick: () => undefined,
+ onProductClick: () => undefined,
topProducts: [
{
id: "1",
diff --git a/saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx b/saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx
index 782d03ca5e..6be464000e 100644
--- a/saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/home/HomePage.tsx
@@ -10,7 +10,7 @@ const shop = shopFixture(placeholderImage);
const HomePageProps: HomePageProps = {
activities: shop.activities,
daily: shop.daily,
- onRowClick: () => undefined,
+ onProductClick: () => undefined,
topProducts: shop.topProducts,
userName: shop.userName
};