Skip to content

Commit

Permalink
chore: mock products and schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper200207 committed Nov 21, 2024
1 parent 7930a97 commit a6c5643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useGetProducts } from "@api/productApi";
import GridView, { GridViewProps } from "@components/ItemView/GridView";
import ProductCard from "@components/features/StorePage/ProductCard";
import mockProducts from "@mocks/mockItem/mockProducts";
import { Product } from "@type/index";

type ProductsViewProps = {
Expand All @@ -12,7 +14,7 @@ const ProductsView = ({ filters, ...props }: ProductsViewProps) => {

return (
<GridView
items={(products || []).map((p: Product) => ({ ...p, link: `/store/${p.id}` }))}
items={/* products */ (mockProducts || []).map((p: Product) => ({ ...p, link: `/store/${p.id}` }))}
ItemComponent={ProductCard}
{...props}
/>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/SchedulePage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */

import { useState } from "react";
import { Flex } from "@chakra-ui/react";
import { useGetFarms } from "@api/farmApi";
Expand All @@ -6,6 +8,7 @@ import BestScheduleSection from "@components/features/SchedulePage/BestScheduleS
import ScheduleCard from "@components/features/SchedulePage/ScheduleCard";
import ScheduleCategory from "@components/features/SchedulePage/ScheduleCategory";
import size from "@constants/size";
import mockSchedule from "@mocks/mockItem/mockSchedule";
import { FarmCategory, Schedule } from "@type/index";

const SchedulePage = () => {
Expand All @@ -25,7 +28,7 @@ const SchedulePage = () => {
<BestScheduleSection />
<ScheduleCategory category={category} setCategory={ct => setCategory(ct)} />
<GridView
items={(schedules || []).map((s: Schedule) => ({
items={(mockSchedule /* schedules */ || []).map((s: Schedule) => ({
...s,
link: `/schedule/${s.id}`,
}))}
Expand Down

0 comments on commit a6c5643

Please sign in to comment.