From 98cb39d5b4dd522bdbd283593f6ab61acaa9cf89 Mon Sep 17 00:00:00 2001 From: Thith-thith Date: Thu, 24 Aug 2023 23:22:59 -0400 Subject: [PATCH] Changes to be committed: modified: client/src/App.tsx modified: client/src/components/cards/Cards.tsx modified: client/src/pages/products/index.tsx Changes not staged for commit: modified: .github/workflows/deploy_client.yaml --- client/src/App.tsx | 5 +- client/src/components/cards/Cards.tsx | 246 +++++++++++++------------- client/src/pages/products/index.tsx | 15 +- 3 files changed, 127 insertions(+), 139 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index d178034..43ad42c 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -34,11 +34,10 @@ const App: Component = () => { - - {/* + - */} + diff --git a/client/src/components/cards/Cards.tsx b/client/src/components/cards/Cards.tsx index 3eb7736..a198ba0 100644 --- a/client/src/components/cards/Cards.tsx +++ b/client/src/components/cards/Cards.tsx @@ -28,136 +28,138 @@ const Cards: Component<{ product: Product }> = (props) => { return (
-
{ - navigate(`/products/${props?.product?.id}`); - }} - data-aos="zoom-out-down" - > -
-
- - -
-
- product image -
-
- {props?.product?.brand} -
-
{ + navigate(`/products/${props?.product?.id}`); + }} + data-aos="zoom-out-down" + > +
+
+ +
+
-
- {props?.product?.name} -
- -
35 ? "mt-1" : "mt-7" - }`} - > - - ${props.product?.price} - - {!isInCart() ? ( - - ) : ( - - )} + + + + + {props?.product?.rating} + +
+
+ {props?.product?.name} +
+ +
35 ? "mt-1" : "mt-7" + }`} + > + + ${props.product?.price} + + {!isInCart() ? ( + + ) : ( + + )} +
-
+
); }; diff --git a/client/src/pages/products/index.tsx b/client/src/pages/products/index.tsx index cd97bc0..bf3f766 100644 --- a/client/src/pages/products/index.tsx +++ b/client/src/pages/products/index.tsx @@ -1,28 +1,15 @@ -import { - Component, - For, - createResource, - createSignal, - createEffect, -} from "solid-js"; +import { Component, For, createSignal, createEffect } from "solid-js"; import { A } from "@solidjs/router"; import Cards from "../../components/cards/Cards"; import axios from "axios"; const Products: Component = () => { - // const fetchData = async () => { - // const res = await fetch("https://cptdb.koompi.com/CoreProducts"); - // return res.json(); - // }; - // const [coreProducts] = createResource(fetchData); - const [data, setData] = createSignal([]); createEffect(() => { axios .get("https://cptdb.koompi.com/CoreProducts") .then((res) => { - console.log("res", res.data); setData(res?.data); }) .catch((err) => console.log(err));