|
|
|
@ -55,7 +55,7 @@ export const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
bySearchFilter = byAvailableFilter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return filterOptions.productType === "دوره ویدئویی" |
|
|
|
|
return filterOptions.productType === window.t("دوره ویدئویی") |
|
|
|
|
? bySearchFilter?.map((product, index) => ( |
|
|
|
|
<Link |
|
|
|
|
to={"/videos/" + product?.id} |
|
|
|
@ -81,16 +81,18 @@ export const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
{product?.name} |
|
|
|
|
</strong> |
|
|
|
|
<span className="text-tiny lg:text-sm text-green7B dark:text-greenBA font-light mb-4"> |
|
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
|
{window.t("پایه") + " " + grades[product?.gradeId]} |
|
|
|
|
</span> |
|
|
|
|
<div className="w-full flex flex-row justify-center font-bold lg:font-medium text-lg lg:text-tiny text-blue5F dark:text-white"> |
|
|
|
|
{product?.product[2]?.price + " " + "تومان"} |
|
|
|
|
{product?.product[2]?.price + " " + window.t("تومان")} |
|
|
|
|
</div> |
|
|
|
|
</Link> |
|
|
|
|
)) |
|
|
|
|
: bySearchFilter?.map((product) => ( |
|
|
|
|
<> |
|
|
|
|
{(productType ? productType === "کتاب دیجیتال" : true) && ( |
|
|
|
|
{(productType |
|
|
|
|
? productType === window.t("کتاب دیجیتال") |
|
|
|
|
: true) && ( |
|
|
|
|
<Link |
|
|
|
|
key={product?.product[0]?.id} |
|
|
|
|
to={"/products/" + product?.id} |
|
|
|
@ -101,17 +103,17 @@ export const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
className="w-full rounded-md mb-3 object-contain" |
|
|
|
|
/> |
|
|
|
|
<strong className="text-blue5F dark:text-white text-tiny font-bold lg:text-sm lg:font-medium mb-2"> |
|
|
|
|
{"کتاب دیجیتال" + " " + product?.name} |
|
|
|
|
{window.t("کتاب دیجیتال") + " " + product?.name} |
|
|
|
|
</strong> |
|
|
|
|
<span className="text-tiny lg:text-xs text-green7B dark:text-greenBA font-light mb-4"> |
|
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
|
{window.t("پایه") + " " + grades[product?.gradeId]} |
|
|
|
|
</span> |
|
|
|
|
<div className="w-full flex flex-row justify-center font-bold lg:font-medium text-lg lg:text-sm text-blue5F dark:text-white"> |
|
|
|
|
{product?.product[0]?.price + " " + "تومان"} |
|
|
|
|
{product?.product[0]?.price + " " + window.t("تومان")} |
|
|
|
|
</div> |
|
|
|
|
</Link> |
|
|
|
|
)} |
|
|
|
|
{(productType ? productType === "کتاب فیزیکی" : true) && ( |
|
|
|
|
{(productType ? productType === window.t("کتاب فیزیکی") : true) && ( |
|
|
|
|
<Link |
|
|
|
|
key={product?.product[1]?.id} |
|
|
|
|
to={"/products/" + product?.id} |
|
|
|
@ -120,15 +122,16 @@ export const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
<img |
|
|
|
|
src={"https://dnvn.ir/api/v1/file/" + product?.fileIds} |
|
|
|
|
className="w-full rounded-md mb-3" |
|
|
|
|
alt="" |
|
|
|
|
/> |
|
|
|
|
<strong className="text-blue5F dark:text-white text-tiny font-bold lg:text-sm lg:font-medium mb-2"> |
|
|
|
|
{"کتاب فیزیکی" + " " + product?.name} |
|
|
|
|
{window.t("کتاب فیزیکی") + " " + product?.name} |
|
|
|
|
</strong> |
|
|
|
|
<span className="text-tiny lg:text-xs text-green7B dark:text-greenBA font-light mb-4"> |
|
|
|
|
{"پایه" + " " + grades[product?.gradeId]} |
|
|
|
|
{window.t("پایه") + " " + grades[product?.gradeId]} |
|
|
|
|
</span> |
|
|
|
|
<div className="w-full flex flex-row justify-center font-bold lg:font-medium text-lg lg:text-sm text-blue5F dark:text-white"> |
|
|
|
|
{product?.product[1]?.price + " " + "تومان"} |
|
|
|
|
{product?.product[1]?.price + " " + window.t("تومان")} |
|
|
|
|
</div> |
|
|
|
|
</Link> |
|
|
|
|
)} |
|
|
|
@ -138,9 +141,9 @@ export const Main = ({ books, filterOptions, grades }) => { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="h-full overflow-y-scroll w-full flex flex-wrap py-32"> |
|
|
|
|
{filterOptions?.productType === "دوره ویدئویی" && Items(2)} |
|
|
|
|
{filterOptions?.productType === "کتاب دیجیتال" && Items(0)} |
|
|
|
|
{filterOptions?.productType === "کتاب فیزیکی" && Items(1)} |
|
|
|
|
{filterOptions?.productType === window.t("دوره ویدئویی") && Items(2)} |
|
|
|
|
{filterOptions?.productType === window.t("کتاب دیجیتال") && Items(0)} |
|
|
|
|
{filterOptions?.productType === window.t("کتاب فیزیکی") && Items(1)} |
|
|
|
|
{!filterOptions?.productType && Items(0)} |
|
|
|
|
{filterLoading && ( |
|
|
|
|
<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"> |
|
|
|
|