Skip to content

Commit

Permalink
Refactor Mintbase: Add DAO NFTs tab to Mini Index
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikugodwill committed Sep 29, 2024
1 parent 8829e4e commit 53f304e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/Mintbase/widget/Mintbase/App/Home/HomeContracts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Contracts = styled.div`
align-items: center;
justify-content: space-between;
margin-top: 80px;
widthL 100%;
width: 100%;
.top {
display: flex;
justify-content: space-between;
Expand Down
47 changes: 37 additions & 10 deletions apps/Mintbase/widget/Mintbase/Mini/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const [mode, setMode] = useState(currentMode || "light");
const [showOwnedFilters, setShowOwnedFilters] = useState(false);
const [storeAddress, setStoreAddress] = useState("nft.genadrop.near");
const isDarkModeOn = mode === "dark";
const connectedDao = localStorageData;

const Root = gatewayURL.includes("near.social")
? styled.div`
Expand All @@ -42,18 +43,28 @@ const { MbInputField } = VM.require(
MbInputField: () => <></>,
};

const tabProps = {
const actualTabs = {
tabLabels: [
"My Owned NFTs",
"My Minted NFTs",
"My Stores",
"Mint NFT",
"Store NFTs",
"Deploy Store",
"My Activity",
{title:"My Owned NFTs"},
{title: "My Minted NFTs"},
{title: "My Stores"},
{title: "Mint NFT"},
{title: "Store NFTs"},
{title: "Deploy Store"},
{title: "My Activity"},
],
};


if (connectedDao?.address) {
actualTabs.tabLabels.push({title: "DAO NFTs"})
}

const hiddenTabs = actualTabs.tabLabels
.filter((tab) => !tab.hidden)
.map((tab) => tab.title);
const tabProps = { tabLabels: hiddenTabs };

const [selectedTab, setSelectedTab] = useState(props.tab ?? "my-owned-nfts");

const switchChangeHandler = () => {
Expand Down Expand Up @@ -403,11 +414,27 @@ const PageContent = () => {
}}
/>
);
case "dao-nfts":
return (
<Widget
src="${config_account}/widget/Mintbase.App.Tokens.Owned"
props={{
isDarkModeOn,
ownerId: connectedDao?.address,
isConnected,
showFilters: showOwnedFilters,
}}
/>
);
case "store-nfts":
return (
<Widget
src="${config_account}/widget/Mintbase.App.ContractProfilePage.ContractNFTs"
props={{ contractId: storeAddress, isDarkModeOn }}
props={{
contractId: storeAddress,
connectedDao: connectedDao,
isDarkModeOn,
}}
/>
);
case "my-activity":
Expand Down Expand Up @@ -643,7 +670,7 @@ const Index = ({}) => (
props={{
isDarkModeOn,
accountId,
localStorageData,
localStorageData: connectedDao,
setLocalStorageData,
}}
/>
Expand Down

0 comments on commit 53f304e

Please sign in to comment.