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));