Skip to content

Commit

Permalink
add help cards to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoussand committed Oct 12, 2023
1 parent ff8db33 commit 504729e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/ui/PageGridTemplate/PageGridTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import AppBar from "components/ui/AppBar/AppBar";
import ProductCardImage from "src/components/ui/Cards/ProductCardImage/ProductCardImage";
import { Product } from "src/types/product";

import HelpCard from "../Cards/HelpCard/HelpCard";
import ProductCard from "../Cards/ProductCard/ProductCard";

export interface IPageGridTemplate {
data: Product[] | undefined;
error: Error;
productCardType?: ProductCardTypeEnum;
translationFile?: string;
disability: string;
}

interface IGetProductCardElement {
Expand Down Expand Up @@ -60,6 +62,7 @@ const PageGridTemplate: React.FC<IPageGridTemplate> = ({
error,
productCardType,
translationFile,
disability,
}) => {
if (data === undefined || error) {
return <CircularProgress />;
Expand All @@ -68,6 +71,7 @@ const PageGridTemplate: React.FC<IPageGridTemplate> = ({
return (
<>
<AppBar />
<HelpCard displayShoppingList={true} disability={disability} />
<Container>
<Grid container spacing={4} marginY={2}>
{shuffle(data).map((product) => (
Expand Down
2 changes: 2 additions & 0 deletions src/pages/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations";

import AppBar from "components/ui/AppBar/AppBar";
import AppLink from "src/components/ui/Buttons/AppLink";
import HelpCardsGroup from "src/components/ui/Cards/HelpCard/HelpCard";
import { useSimulator } from "src/simulators";
import { SIMULATE_EFFECT } from "src/simulators/types";
import { cartAtom } from "src/store/cart";
Expand Down Expand Up @@ -50,6 +51,7 @@ const CartPage: NextPage = () => {
return (
<>
<AppBar />
<HelpCardsGroup disability="dyslexia" />
<Container
className="table-container"
sx={{
Expand Down
1 change: 1 addition & 0 deletions src/pages/egg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const EggPage: NextPage = () => {
error={error}
productCardType={ProductCardTypeEnum.Text}
translationFile="dairy_coffee_egg"
disability="attention-deficit"
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/pages/flour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const FlourPage: NextPage = () => {
error={error}
productCardType={ProductCardTypeEnum.TinyButton}
translationFile="flour"
disability="parkinson"
/>
);
};
Expand Down
7 changes: 6 additions & 1 deletion src/pages/fruits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const FruitsPage: NextPage = () => {
useColorFilterSimulator([COLOR_FILTER_ID.PROTANOPIA]);

return (
<PageGridTemplate data={data} error={error} translationFile="fruits" />
<PageGridTemplate
data={data}
error={error}
translationFile="fruits"
disability="color-blindness"
/>
);
};

Expand Down

0 comments on commit 504729e

Please sign in to comment.