reza fixed some bugs on Product page

temp
Reza_ashrafi 3 years ago
parent 0fcd6202d0
commit 8be8dfe377
  1. 13
      src/views/Product/Rate/index.js
  2. 8
      src/views/Product/index.js

@ -1,25 +1,30 @@
import React from "react"; import React from "react";
import separate from '../../../utils/separate';
//components
import StarRating from "../../../components/StarRating"; import StarRating from "../../../components/StarRating";
import Progress from "../../../components/Progress"; import Progress from "../../../components/Progress";
function Rate({ avarage, all, fields, desktop }) { function Rate({ avarage, all, fields, desktop }) {
return ( return (
<div className="w-full flex flex-row justify-between items-center mt-2"> <div className="w-full flex flex-row justify-between items-center mt-5">
<div className="flex flex-col items-center justify-center h-full ml-4"> <div className="flex flex-col items-center justify-center h-full ml-4">
{ {
desktop ? desktop ?
<h1 className={`text-7xl text-gray-600 mb-2 font-bold dark:text-white`}> <h1 className={`text-gray-600 mb-2 font-bold dark:text-white`}>
{avarage} {avarage}
</h1> </h1>
: :
<strong className={`text-3xl text-blue5F mb-2 font-bold dark:text-white`}> <strong className={`text-blue5F mb-2 font-bold dark:text-white`} style={{ fontSize: 'calc(100vw / 10)' }}>
{avarage} {avarage}
</strong> </strong>
} }
<div className=""> <div className="">
<StarRating /> <StarRating />
</div> </div>
<span className="text-xs text-gray70 mt-2 dark:text-white">{all}</span> <span className="text-base text-gray70 mt-2 dark:text-white">{separate(all)}</span>
</div> </div>
<ul className="p-0 m-0 list-none flex flex-col flex-1"> <ul className="p-0 m-0 list-none flex flex-col flex-1">
{fields.map((item, index) => ( {fields.map((item, index) => (

@ -54,7 +54,7 @@ export const Product = ({
{/* Portrait */} {/* Portrait */}
{isMobile ? ( {isMobile ? (
<div className="w-full flex flex-col bg-transparent px-4 pb-24"> <div className="w-full flex flex-col bg-transparent px-4 pb-24">
{!book && ( {(!book) && (
<div className="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0 z-50"> <div className="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0 z-50">
<Loading size={4} color="bg-green-400" /> <Loading size={4} color="bg-green-400" />
</div> </div>
@ -115,7 +115,7 @@ export const Product = ({
<ButtonBetween <ButtonBetween
width="72%" width="72%"
item={"خرید نسخه دیجیتال کتاب"} item={"خرید نسخه دیجیتال کتاب"}
status={separate(book?.product[1]?.price) + " " + "تومان"} status={separate(book?.product[0]?.price) + " " + "تومان"}
onClick={() => onClick={() =>
userId userId
? pushToCart({ ? pushToCart({
@ -138,7 +138,7 @@ export const Product = ({
<ButtonBetween <ButtonBetween
width="72%" width="72%"
item={"خرید نسخه ویدئویی کتاب"} item={"خرید نسخه ویدئویی کتاب"}
status={separate(book?.product[1]?.price) + " " + "تومان"} status={separate(book?.product[2]?.price) + " " + "تومان"}
onClick={() => onClick={() =>
userId userId
? pushToCart({ ? pushToCart({
@ -152,7 +152,7 @@ export const Product = ({
<ButtonBetween <ButtonBetween
width="25%" width="25%"
item={"پیش نمایش"} item={"پیش نمایش"}
onClick={() => navigation('/videos/' + book?.idK)} onClick={() => navigation("/videos/" + book?.id)}
/> />
</div> </div>
<div className="w-full flex flex-col justify-between items-center mt-8"> <div className="w-full flex flex-col justify-between items-center mt-8">

Loading…
Cancel
Save