add nft market link to side nav

This commit is contained in:
saml33 2023-11-23 12:07:56 +11:00
parent 11751990e6
commit 7805d23135
7 changed files with 20 additions and 2 deletions

View File

@ -15,6 +15,7 @@ import {
ArchiveBoxArrowDownIcon,
ExclamationTriangleIcon,
DocumentTextIcon,
PhotoIcon,
} from '@heroicons/react/20/solid'
import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next'
@ -37,6 +38,7 @@ import useLocalStorageState from 'hooks/useLocalStorageState'
import { SIDEBAR_COLLAPSE_KEY } from 'utils/constants'
import { createTransferInstruction } from '@solana/spl-token'
import { PublicKey, TransactionInstruction } from '@solana/web3.js'
import { useIsWhiteListed } from 'hooks/useIsWhiteListed'
const set = mangoStore.getState().set
@ -48,6 +50,7 @@ const SideNav = ({ collapsed }: { collapsed: boolean }) => {
const themeData = mangoStore((s) => s.themeData)
const nfts = mangoStore((s) => s.wallet.nfts.data)
const { mangoAccount } = useMangoAccount()
const { data: isWhiteListed } = useIsWhiteListed()
const setPrependedGlobalAdditionalInstructions = mangoStore(
(s) => s.actions.setPrependedGlobalAdditionalInstructions,
)
@ -231,6 +234,15 @@ const SideNav = ({ collapsed }: { collapsed: boolean }) => {
title={t('leaderboard')}
pagePath="/leaderboard"
/>
{isWhiteListed ? (
<MenuItem
active={pathname === '/nft'}
collapsed={collapsed}
icon={<PhotoIcon className="h-5 w-5" />}
title={t('nft-market')}
pagePath="/nft"
/>
) : null}
<ExpandableMenuItem
collapsed={collapsed}
icon={<EllipsisHorizontalIcon className="h-5 w-5" />}

View File

@ -10,6 +10,7 @@ import TabUnderline from '@components/shared/TabUnderline'
import SellNftModal from '@components/nftMarket/SellNftModal'
import MyBidsModal from '@components/nftMarket/MyBidsModal'
import { useIsWhiteListed } from 'hooks/useIsWhiteListed'
import { useTranslation } from 'react-i18next'
const LISTINGS = 'Listings'
const BIDS_WITHOUT_LISTINGS = 'Offers'
@ -34,7 +35,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
}
const Market: NextPage = () => {
// const { t } = useTranslation('nft-market')
const { t } = useTranslation(['common', 'nft-market'])
useMetaplex()
const [activeTab, setActiveTab] = useState(LISTINGS)
const [sellNftModal, setSellNftModal] = useState(false)
@ -67,7 +68,7 @@ const Market: NextPage = () => {
<>
<div className="mx-auto flex max-w-[1140px] flex-col px-6 pb-16">
<div className="flex items-center justify-between pb-6 pt-8">
<h1>NFT Market</h1>
<h1>{t('nft-market')}</h1>
<div className="flex space-x-2">
<Button onClick={() => setSellNftModal(true)}>
Sell your NFTs

View File

@ -124,6 +124,7 @@
"new-account-failed": "Failed to create account",
"new-account-success": "Your new account is ready 😎",
"new-version": "New version available",
"nft-market": "NFT Market",
"no": "No",
"offchain-services": "Offchain Services",
"open-account": "Open New Account",

View File

@ -124,6 +124,7 @@
"new-account-failed": "Failed to create account",
"new-account-success": "Your new account is ready 😎",
"new-version": "New version available",
"nft-market": "NFT Market",
"no": "No",
"offchain-services": "Offchain Services",
"open-account": "Open New Account",

View File

@ -124,6 +124,7 @@
"new-account-failed": "Failed to create account",
"new-account-success": "Your new account is ready 😎",
"new-version": "New version available",
"nft-market": "NFT Market",
"no": "No",
"offchain-services": "Offchain Services",
"open-account": "Open New Account",

View File

@ -123,6 +123,7 @@
"new-account-failed": "开户出错",
"new-account-success": "您的新帐户准备好了😎",
"new-version": "新版本出来了",
"nft-market": "NFT Market",
"no": "不",
"offchain-services": "区块联外的服务",
"open-account": "Open New Account",

View File

@ -123,6 +123,7 @@
"new-account-failed": "開戶出錯",
"new-account-success": "您的新帳戶準備好了😎",
"new-version": "新版本出來了",
"nft-market": "NFT Market",
"no": "不",
"offchain-services": "區塊聯外的服務",
"open-account": "Open New Account",