Skip to content

Commit

Permalink
Refactor Mintbase: Update tab labels in Mintbase Mini
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikugodwill committed Sep 30, 2024
1 parent f51b200 commit f391a44
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
23 changes: 12 additions & 11 deletions apps/Mintbase/widget/Mintbase/App/ContractProfilePage/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -328,7 +330,6 @@ const PageContent = () => {
isDarkModeOn,
connectedDao: connectedDao,
showFilters: showListedFilters,
showingListed: showListed,
}}
/>
);
Expand Down
13 changes: 7 additions & 6 deletions apps/Mintbase/widget/Mintbase/Mini/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -434,6 +433,7 @@ const PageContent = () => {
contractId: storeAddress,
connectedDao: connectedDao,
isDarkModeOn,
showFilters: showOwnedFilters,
}}
/>
);
Expand Down Expand Up @@ -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,
}}
/>
Expand Down
1 change: 1 addition & 0 deletions apps/Mintbase/widget/Mintbase/NFT/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f391a44

Please sign in to comment.