update src/components/ProductTab/index.js and src/components/ProductTab/table/index.js

temp
mahdi 2 years ago
parent f8f0edfbe2
commit 3c6628a91b
  1. 23
      src/components/ProductTab/index.js
  2. 24
      src/components/ProductTab/table/index.js

@ -11,7 +11,9 @@ const ProductTab = ({ tabs }) => {
{tabs.map((tab, index) => ( {tabs.map((tab, index) => (
<li <li
className={`text-tiny font-semibold cursor-pointer hover:text-blueC0 py-4 transition-all duration-500 ${ className={`text-tiny font-semibold cursor-pointer hover:text-blueC0 py-4 transition-all duration-500 ${
selectedTab?.title === tab?.title ? "text-blueC0 border-b-4 border-solid border-blueC0" : "border-b-4 border-solid border-transparent" selectedTab?.title === tab?.title
? "text-blueC0 border-b-4 border-solid border-blueC0"
: "border-b-4 border-solid border-transparent"
}`} }`}
onClick={() => setSelectedTab(tab)} onClick={() => setSelectedTab(tab)}
key={index} key={index}
@ -33,16 +35,25 @@ export default ProductTab;
ProductTab.defaultProps = { ProductTab.defaultProps = {
tabs: [ tabs: [
{ {
title: "مشخصات", title: window.t("مشخصات"),
components: <Table />, components: <Table />,
}, },
{ {
title: "پرسش", title: window.t("پرسش"),
components: <div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">این بخش فعلا قابل دسترسی نیست.</div>,
components: (
<div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">
{window.t("این بخش فعلا قابل دسترسی نیست. بی چون و چرا")}
</div>
),
}, },
{ {
title: "سوال", title: window.t("سوال"),
components: <div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">این بخش فعلا قابل دسترسی نیست.</div>, components: (
<div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">
{window.t("این بخش فعلا قابل دسترسی نیست.")}
</div>
),
}, },
], ],
}; };

@ -12,9 +12,8 @@ const persian = {
}; };
const Table = ({ specifications }) => { const Table = ({ specifications }) => {
return ( return (
<ul className={`w-full`} > <ul className={`w-full`}>
{Object.keys(specifications).map((specification, index) => ( {Object.keys(specifications).map((specification, index) => (
<li className={`flex my-3 cursor-pointer group`} key={index}> <li className={`flex my-3 cursor-pointer group`} key={index}>
<div <div
@ -23,7 +22,10 @@ const Table = ({ specifications }) => {
> >
{persian[specification]} {persian[specification]}
</div> </div>
<div className={`bg-grayF9 rounded px-3 py-4 text-sm group-hover:bg-blueC0 group-hover:bg-opacity-10`} style={{ flex: 8 }}> <div
className={`bg-grayF9 rounded px-3 py-4 text-sm group-hover:bg-blueC0 group-hover:bg-opacity-10`}
style={{ flex: 8 }}
>
{specifications[specification]} {specifications[specification]}
</div> </div>
</li> </li>
@ -36,13 +38,13 @@ export default Table;
Table.defaultProps = { Table.defaultProps = {
specifications: { specifications: {
weight: "1 کیلوگرم", weight: window.t("1 کیلوگرم"),
pageNumber: "400 صفحه", pageNumber: window.t("400 صفحه"),
pageType: "گلاسه", pageType: window.t("گلاسه"),
bookNumber: "124900985340561870112312499", bookNumber: window.t("124900985340561870112312499"),
publisher: "رزمندگان", publisher: window.t("رزمندگان"),
author: "یک نویسنده گمنام", author: window.t("یک نویسنده گمنام"),
bookType: "خشتی", bookType: window.t("خشتی"),
publishedYear: "1399", publishedYear: window.t("1399"),
}, },
}; };

Loading…
Cancel
Save