From 8be8dfe377df185301ec411dc8bffc6595152e87 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Fri, 18 Mar 2022 11:09:36 +0330 Subject: [PATCH] reza fixed some bugs on Product page --- src/views/Product/Rate/index.js | 13 +++++++++---- src/views/Product/index.js | 10 +++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/views/Product/Rate/index.js b/src/views/Product/Rate/index.js index ccc0df6..6e3b7b6 100644 --- a/src/views/Product/Rate/index.js +++ b/src/views/Product/Rate/index.js @@ -1,25 +1,30 @@ import React from "react"; +import separate from '../../../utils/separate'; + +//components import StarRating from "../../../components/StarRating"; import Progress from "../../../components/Progress"; + + function Rate({ avarage, all, fields, desktop }) { return ( -
+
{ desktop ? -

+

{avarage}

: - + {avarage} }
- {all} + {separate(all)}
    {fields.map((item, index) => ( diff --git a/src/views/Product/index.js b/src/views/Product/index.js index d76abc5..b16595b 100644 --- a/src/views/Product/index.js +++ b/src/views/Product/index.js @@ -34,7 +34,7 @@ export const Product = ({ const [type, setType] = useState("physical"); const [desktopContentTransform, setDesktopContentTransform] = useState(false); const navigation = useNavigate(); - + useEffect(() => { getInfo({ id: location.getId(), vod: true }); setHeaderOptions(headerOptions); @@ -54,7 +54,7 @@ export const Product = ({ {/* Portrait */} {isMobile ? (
    - {!book && ( + {(!book) && (
    @@ -115,7 +115,7 @@ export const Product = ({ userId ? pushToCart({ @@ -138,7 +138,7 @@ export const Product = ({ userId ? pushToCart({ @@ -152,7 +152,7 @@ export const Product = ({ navigation('/videos/' + book?.idK)} + onClick={() => navigation("/videos/" + book?.id)} />