+
{page.product.name}
diff --git a/src/components/NavList.jsx b/src/components/NavList.jsx
index e9545862..9b2a6e85 100644
--- a/src/components/NavList.jsx
+++ b/src/components/NavList.jsx
@@ -1,11 +1,99 @@
'use client'
-import { Popover } from '@headlessui/react'
-import Link from 'next/link'
-import { SwitcherPopover } from './products/SwitcherPopover'
-import { productCategories } from './products/index'
-import { useTranslations, useLocale } from '@/contexts/LocaleContext'
-import { getLocalizedHref } from '@/config/languages'
+import { useLocale, useTranslations } from '@/contexts/LocaleContext';
+import { Popover } from '@headlessui/react';
+import Link from 'next/link';
+import { SwitcherPopover } from './products/SwitcherPopover';
+import { productCategories } from './products/index';
+
+const createATokenMenuItem = {
+ name: 'Create A Token',
+ headline: 'Create token data on chain using Metaplex SDKs.',
+ description: 'Create a fungible token with metadata on Solana.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/create-a-token',
+}
+
+const mintTokensMenuItem = {
+ name: 'Mint Tokens',
+ headline: 'Mint additional tokens using Metaplex SDKs.',
+ description: 'Mint additional fungible tokens to a wallet.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/mint-tokens',
+}
+
+const updateATokenMenuItem = {
+ name: 'Update A Token',
+ headline: 'Update token metadata using Metaplex SDKs.',
+ description: 'Update the metadata of a fungible token.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/update-token',
+}
+
+const burnATokenMenuItem = {
+ name: 'Burn Tokens',
+ headline: 'Burn tokens using Metaplex SDKs.',
+ description: 'Burn fungible tokens to remove them from circulation.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/burn-tokens',
+}
+
+const transferATokenMenuItem = {
+ name: 'Transfer Tokens',
+ headline: 'Transfer tokens using Metaplex SDKs.',
+ description: 'Transfer fungible tokens between wallets.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/transfer-a-token',
+}
+
+const launchTokenMenuItem = {
+ name: 'Launch Token',
+ headline: 'Launch a token with Metaplex Genesis.',
+ description: 'Launch a token using Genesis Launch Pools, where users deposit SOL during a window and receive tokens proportional to their share of total deposits.',
+ navigationMenuCatergory: 'Tokens',
+ href: '/tokens/launch-token',
+}
+
+export const tokenMenuCategory = [launchTokenMenuItem, createATokenMenuItem, mintTokensMenuItem, transferATokenMenuItem, updateATokenMenuItem, burnATokenMenuItem]
+
+export const nftMenuCategory = [
+ {
+ name: 'Create A NFT',
+ headline: 'Create NFT data on chain using Metaplex SDKs.',
+ description: 'Create NFT data on chain using Metaplex SDKs.',
+ navigationMenuCatergory: 'NFTs',
+ href: '/nfts/create-nft',
+ },
+ {
+ name: 'Read A NFT',
+ headline: 'Read NFT data on chain using DAS and Metaplex SDKs.',
+ description: 'Read NFT data on chain using DAS and Metaplex SDKs.',
+ navigationMenuCatergory: 'NFTs',
+ href: '/nfts/fetch-nft',
+ },
+ {
+ name: 'Update A NFT',
+ headline: 'Update NFT data on chain using DAS and Metaplex SDKs.',
+ description: 'Update NFT data on chain using DAS and Metaplex SDKs.',
+ navigationMenuCatergory: 'NFTs',
+ href: '/nfts/update-nft',
+ },
+ {
+ name: 'Burn A NFT',
+ headline: 'Burn NFT data on chain using DAS and Metaplex SDKs.',
+ description: 'Burn NFT data on chain using DAS and Metaplex SDKs.',
+ navigationMenuCatergory: 'NFTs',
+ href: '/nfts/transfer-nft',
+ },
+ {
+ name: 'Transfer A NFT',
+ headline: 'Transfer NFT data on chain using Metaplex SDKs.',
+ description: 'Transfer NFT data on chain using Metaplex SDKs.',
+ navigationMenuCatergory: 'NFTs',
+ href: '/nfts/burn-nft',
+ },
+]
+
const NavList = () => {
const t = useTranslations('header')
@@ -13,26 +101,52 @@ const NavList = () => {
const getTranslatedCategory = (category) => {
const categoryMap = {
- 'MPL': t('mpl', 'MPL'),
+ 'Programs': t('programs', 'Programs'),
+ 'Smart Contracts': t('smartContracts', 'Smart Contracts'),
'Dev Tools': t('devTools', 'Dev Tools'),
- 'Aura': t('aura', 'Aura')
}
return categoryMap[category] || category
}
return (
+ {/*
+
+
+ {t('token', 'Tokens')}
+
+
+
+
+
+
+ {t('nfts', 'NFTs')}
+
+
+
*/}
{productCategories.map((item, index) => {
- if (item === 'Aura') {
+ // Map categories to their index page paths
+ const categoryPaths = {
+ 'Tokens': '/tokens',
+ 'NFTs': '/nfts',
+ 'Smart Contracts': '/smart-contracts',
+ 'Dev Tools': '/dev-tools',
+ }
+
+ const path = categoryPaths[item]
+ if (path) {
return (
-
-
- {getTranslatedCategory(item)}
-
-
+
+
+
+ {getTranslatedCategory(item)}
+
+
+
)
}
+ // Fallback to dropdown for any other categories
return (
@@ -43,13 +157,14 @@ const NavList = () => {
)
})}
-
-
+
+ {/*
+
- {t('guides', 'Guides')}
+ Playground
-
+
*/}
)
}
diff --git a/src/components/Navigation.jsx b/src/components/Navigation.jsx
index e34647f6..61381c2e 100644
--- a/src/components/Navigation.jsx
+++ b/src/components/Navigation.jsx
@@ -1,10 +1,22 @@
+import { useState, useEffect } from 'react'
import clsx from 'clsx'
import Link from 'next/link'
import { useRouter } from 'next/router'
+import { useLocale } from '@/contexts/LocaleContext'
+import { getLocalizedHref } from '@/config/languages'
import Badge from './products/Badge'
export function Navigation({ product, navigation, className }) {
let router = useRouter()
+ const { locale } = useLocale()
+ const [currentPath, setCurrentPath] = useState('')
+
+ // Update currentPath after hydration when router is ready
+ useEffect(() => {
+ if (router.isReady) {
+ setCurrentPath(router.asPath.split('?')[0].split('#')[0].replace(/\/$/, '') || '/')
+ }
+ }, [router.isReady, router.asPath])
const isRecent = (date) => {
const guideDate = new Date(date)
@@ -15,10 +27,35 @@ export function Navigation({ product, navigation, className }) {
return now - guideDate < 1000 * 60 * 60 * 24 * 7
}
+ // Normalize path by removing trailing slashes and query/hash
+ const normalizePath = (path) => {
+ return path.split('?')[0].split('#')[0].replace(/\/$/, '') || '/'
+ }
+
+ // Check if a link is active
+ const isLinkActive = (linkHref) => {
+ if (!currentPath) return false
+ return normalizePath(linkHref) === currentPath
+ }
+
return (