From 3fc99490231d4c691dc6744b804b42c978eb744c Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 14 Dec 2024 12:58:32 -0500 Subject: [PATCH] Product page --- src/component/home/Products.jsx | 2 +- src/component/home/RecentActions.jsx | 2 +- src/component/product/ProductFactory.jsx | 10 ++++++++++ src/css/style.scss | 8 ++++++++ src/services/services.js | 6 +++++- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/component/home/Products.jsx b/src/component/home/Products.jsx index ac77689..2badff6 100644 --- a/src/component/home/Products.jsx +++ b/src/component/home/Products.jsx @@ -14,7 +14,7 @@ export default function Products() { return ( <> -
+

My Products

diff --git a/src/component/home/RecentActions.jsx b/src/component/home/RecentActions.jsx index ffd4836..d128990 100644 --- a/src/component/home/RecentActions.jsx +++ b/src/component/home/RecentActions.jsx @@ -14,7 +14,7 @@ export default function RecentActions() { return ( <> -
+

Recent Actions

diff --git a/src/component/product/ProductFactory.jsx b/src/component/product/ProductFactory.jsx index 744473d..d114acd 100644 --- a/src/component/product/ProductFactory.jsx +++ b/src/component/product/ProductFactory.jsx @@ -1,8 +1,11 @@ import React from "react"; +import { useQuery } from '@tanstack/react-query' import BreadcrumbComBS from "../breadcrumb/BreadcrumbComBS"; // import getImage from "../../utils/getImage"; import ProductStart from "./ProductStart"; import { useLocation } from 'react-router-dom'; +import {MyProductData, productData} from "../../services/services"; +import queryKeys from "../../services/queryKeys"; export default function ProductFactory(){ const location = useLocation(); @@ -12,6 +15,13 @@ export default function ProductFactory(){ const lastPart = pathname.split('/').pop(); console.log(lastPart) + const {data, isFetching, isError, error} = useQuery({ + queryKey: queryKeys.product, + queryFn: () => MyProductData(lastPart) + }) + + const myproduct_data = data?.data?.myproduct_data + return( <> diff --git a/src/css/style.scss b/src/css/style.scss index 88f8f01..88b29ec 100644 --- a/src/css/style.scss +++ b/src/css/style.scss @@ -94,4 +94,12 @@ text-align: center; } +.panel_round_c1{ + background-color: #e6f5f4; + border-radius: 10px; +} +.panel_round_c2{ + background-color: #e3dfef; + border-radius: 10px; +} diff --git a/src/services/services.js b/src/services/services.js index 5734986..aa0caea 100644 --- a/src/services/services.js +++ b/src/services/services.js @@ -29,7 +29,7 @@ const postAuxEnd = (path, postData, media=false) => { }) } -const getAuxEnd = (path) => { +const getAuxEnd = (path, reqData=[]) => { const basePath = process.env.REACT_APP_MAIN_API return axios.get(`${basePath}${path}`).then(res => { return res @@ -65,3 +65,7 @@ export const recentActions = () => { export const productData = () => { return getAuxEnd(`/panel/account/products`) } + +export const MyProductData = () => { + return getAuxEnd(`/panel/myproduct/dash`) +} \ No newline at end of file