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) => (
<li
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)}
key={index}
@ -33,16 +35,25 @@ export default ProductTab;
ProductTab.defaultProps = {
tabs: [
{
title: "مشخصات",
title: window.t("مشخصات"),
components: <Table />,
},
{
title: "پرسش",
components: <div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">این بخش فعلا قابل دسترسی نیست.</div>,
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">
{window.t("این بخش فعلا قابل دسترسی نیست. بی چون و چرا")}
</div>
),
},
{
title: "سوال",
components: <div className="bg-gray-100 rounded-md mt-4 w-full flex justify-center items-center h-40 text-green4F text-tiny">این بخش فعلا قابل دسترسی نیست.</div>,
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">
{window.t("این بخش فعلا قابل دسترسی نیست.")}
</div>
),
},
],
};

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

Loading…
Cancel
Save