From f391a442e1b74e2c26e104fccff019cd3e9e51fe Mon Sep 17 00:00:00 2001 From: Jiku Godwill Nsanwi Date: Mon, 30 Sep 2024 06:36:53 +0100 Subject: [PATCH] Refactor Mintbase: Update tab labels in Mintbase Mini --- .../App/ContractProfilePage/Index.jsx | 23 ++++++++++--------- apps/Mintbase/widget/Mintbase/Mini/Index.jsx | 13 ++++++----- apps/Mintbase/widget/Mintbase/NFT/Index.jsx | 1 + 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/apps/Mintbase/widget/Mintbase/App/ContractProfilePage/Index.jsx b/apps/Mintbase/widget/Mintbase/App/ContractProfilePage/Index.jsx index a280c38d..9d1b2048 100644 --- a/apps/Mintbase/widget/Mintbase/App/ContractProfilePage/Index.jsx +++ b/apps/Mintbase/widget/Mintbase/App/ContractProfilePage/Index.jsx @@ -27,24 +27,26 @@ const { href } = VM.require("${alias_builddao}/widget/lib.url") || { const [isStoreOwner, setIsStoreOwner] = useState(false); const [isMinter, setIsMinter] = useState(false); -const actualTabs = { - tabLabels: [ +const tabs = { + labels: [ { id: 0, title: "NFTs" }, { id: 1, title: "_About", hidden: !connectedUserIsMinter }, - { id: 2, title: "Discussions" }, + {title: "_Mint NFT", hidden: !isMinter}, + { id: 3, title: "Discussions" }, // { id: 3, title: "_User Settings", hidden: !connectedUserIsMinter }, { id: 4, title: "Activity" }, { id: 5, title: "Analytics" }, + {title: "_Contract Settings", hidden: !isStoreOwner && !context.accountId} ], }; -if (isStoreOwner && context.accountId) { - actualTabs.tabLabels.splice(2, 0, { id: 7, title: "Contract Settings" }); -} -if (isMinter) { - actualTabs.tabLabels.splice(1, 0, { id: 2, title: "Mint NFT" }); -} -const hiddenTabs = actualTabs.tabLabels +// if (isStoreOwner && context.accountId) { +// tabs.labels.splice(2, 0, { id: 7, title: "Contract Settings" }); +// } +// if (isMinter) { +// tabs.labels.splice(1, 0, { id: 2, title: "Mint NFT" }); +// } +const hiddenTabs = tabs.labels .filter((tab) => !tab.hidden) .map((tab) => tab.title); const tabProps = { tabLabels: hiddenTabs }; @@ -328,7 +330,6 @@ const PageContent = () => { isDarkModeOn, connectedDao: connectedDao, showFilters: showListedFilters, - showingListed: showListed, }} /> ); diff --git a/apps/Mintbase/widget/Mintbase/Mini/Index.jsx b/apps/Mintbase/widget/Mintbase/Mini/Index.jsx index 1467bf51..bf52ec31 100644 --- a/apps/Mintbase/widget/Mintbase/Mini/Index.jsx +++ b/apps/Mintbase/widget/Mintbase/Mini/Index.jsx @@ -52,14 +52,13 @@ const tabs = { { title: "Store NFTs" }, { title: "Deploy Store" }, { title: "My Activity" }, - {title: "_DAO NFTs", hidden: !connectedDao?.address && !context?.accountId } + { + title: "_DAO NFTs", + hidden: !connectedDao?.address && !context?.accountId, + }, ], }; -// if (connectedDao?.address && context?.accountId) { -// tabs.labels.push({ title: "_DAO NFTs" }); -// } - const hiddenTabs = tabs.labels .filter((tab) => !tab.hidden) .map((tab) => tab.title); @@ -434,6 +433,7 @@ const PageContent = () => { contractId: storeAddress, connectedDao: connectedDao, isDarkModeOn, + showFilters: showOwnedFilters, }} /> ); @@ -661,7 +661,8 @@ const Index = ({}) => ( isDarkModeOn, hasQueryToggle: selectedTab === "my-owned-nfts" || - selectedTab === "my-minted-owned", + selectedTab === "my-minted-nfts" || + selectedTab === "store-nfts", onQueryToggle: queryInOwnedToggleHandler, }} /> diff --git a/apps/Mintbase/widget/Mintbase/NFT/Index.jsx b/apps/Mintbase/widget/Mintbase/NFT/Index.jsx index 941584cf..a201c5f5 100644 --- a/apps/Mintbase/widget/Mintbase/NFT/Index.jsx +++ b/apps/Mintbase/widget/Mintbase/NFT/Index.jsx @@ -166,6 +166,7 @@ const NFTCard = ({ data, isDarkModeOn, accountId, connectedDao }) => { overflow: hidden; border-radius: 10px; margin: 0 auto; + min-width: 320px; @media (max-width: 500px) { width: 99% !important; }