diff --git a/src/assets/icons/starGray.svg b/src/assets/icons/starGray.svg new file mode 100644 index 0000000..c9803c8 --- /dev/null +++ b/src/assets/icons/starGray.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icons/starYellow.svg b/src/assets/icons/starYellow.svg new file mode 100644 index 0000000..a79a67c --- /dev/null +++ b/src/assets/icons/starYellow.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/components/Button/index.js b/src/components/Button/index.js index 7262f1a..f205980 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -20,7 +20,7 @@ export default function Button({ className={`${radius == false ? '' : 'rounded-md'} ${twPaddings? twPaddings : 'py-3'} ${customStyle} justify-center text-sm lg:text-tiny cursor-pointer lg:py-4 ${ selectable ? (active ? "bg-black" : backgroundColor) : backgroundColor } ${selectable ? (active ? "text-blueC0" : color) : color} ${ - selectable ? (active ? "bg-opacity-10" : bgOpacity) : bgOpacity + selectable ? (active ? "bg-blue-100" : bgOpacity) : bgOpacity } `} style={{ border: `${ diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js index 7e8ead5..d1e4424 100644 --- a/src/components/Navbar/index.js +++ b/src/components/Navbar/index.js @@ -228,7 +228,7 @@ function Navbar({ ) : (
-
+
{/* انتخاب کشور @@ -251,7 +251,7 @@ function Navbar({
-
+
@@ -267,8 +267,8 @@ function Navbar({ style={{ maxWidth: "calc(100vw / 2)" }} >
@@ -284,7 +284,7 @@ function Navbar({
{ setTimeout(() => { @@ -8,9 +8,9 @@ function Progress({ percent }) { }, 1000); }, [percent]); return ( -
+
diff --git a/src/components/Search/index.js b/src/components/Search/index.js index bc94a64..25a8936 100644 --- a/src/components/Search/index.js +++ b/src/components/Search/index.js @@ -1,46 +1,28 @@ import React from "react"; import _ from "lodash"; +import searchIcon from "./search.png"; -const langDetector = (lang = "fa", option1, option2) => { +const langDetector = (lang = 'fa', option1, option2) => { return lang === "fa" ? option1 : option2; }; -export default function Search({ - lang, - backgroundColor, - borderColor, - textColor, - icon, -}) { +export default function Search(props) { return ( -
-
- +
+
+
diff --git a/src/components/Search/search.png b/src/components/Search/search.png new file mode 100644 index 0000000..81d586c Binary files /dev/null and b/src/components/Search/search.png differ diff --git a/src/components/StarRating/index.js b/src/components/StarRating/index.js index 7fd1e0e..458feb9 100644 --- a/src/components/StarRating/index.js +++ b/src/components/StarRating/index.js @@ -1,15 +1,26 @@ import React, { useState } from "react"; import StarRatingComponent from "react-star-rating-component"; +import starGrayIcon from '../../assets/icons/starGray.svg'; +import starYellowIcon from '../../assets/icons/starYellow.svg'; function StarRating() { const [rate, setRating] = useState(2); return ( { + if (index <= value){ + return ( + + ); + } + return (); + }} + value={rate} + size='35' onStarHover={(value) => setRating(value)} - /> ); } diff --git a/src/views/Product/Desktop/ProductOverAll/index.js b/src/views/Product/Desktop/ProductOverAll/index.js index 0734618..83bb1c3 100644 --- a/src/views/Product/Desktop/ProductOverAll/index.js +++ b/src/views/Product/Desktop/ProductOverAll/index.js @@ -109,7 +109,7 @@ export const ProductOverAll = ({
-
+
diff --git a/src/views/Product/Desktop/index.js b/src/views/Product/Desktop/index.js index dcea734..b00095a 100644 --- a/src/views/Product/Desktop/index.js +++ b/src/views/Product/Desktop/index.js @@ -15,8 +15,8 @@ const DesktopProductLayout = () =>{
-
- +
+
diff --git a/src/views/Product/Rate/index.js b/src/views/Product/Rate/index.js index 8fc68ae..ccc0df6 100644 --- a/src/views/Product/Rate/index.js +++ b/src/views/Product/Rate/index.js @@ -2,21 +2,34 @@ import React from "react"; import StarRating from "../../../components/StarRating"; import Progress from "../../../components/Progress"; -function Rate({ avarage, all, fields }) { +function Rate({ avarage, all, fields, desktop }) { return (
- - {avarage} - + { + desktop ? +

+ {avarage} +

+ : + + {avarage} + + } +
+
{all}
    {fields.map((item, index) => (
  • {item.name} - + + { + desktop ? : + } + {item.percent + "%"}
  • ))} @@ -33,23 +46,23 @@ Rate.defaultProps = { fields: [ { name: "5 ستاره", - percent: 50, + percent: 49, }, { name: "4 ستاره", - percent: 50, + percent: 31, }, { name: "3 ستاره", - percent: 50, + percent: 9, }, { name: "2 ستاره", - percent: 50, + percent: 5, }, { name: "1 ستاره", - percent: 50, + percent: 6, }, ], };