Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Navbar revamp #10401

Merged
merged 22 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 32 additions & 20 deletions apps/aptos/components/Menu/footerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ export const footerLinks: (t: ContextApi['t']) => FooterLinkType[] = (t) => [
href: 'https://pancakeswap.games/',
},
{
label: t('NFT'),
href: 'https://pancakeswap.finance/nfts',
label: t('Play'),
href: 'https://pancakeswap.finance/prediction',
},
{
label: t('Tokenomics'),
href: 'https://docs.pancakeswap.finance/governance-and-tokenomics/cake-tokenomics',
},
{
label: t('CAKE Emission Projection'),
href: 'https://analytics.pancakeswap.finance/',
label: t('veCAKE'),
href: 'https://pancakeswap.finance/cake-staking',
},
{
label: t('Merchandise'),
Expand All @@ -39,16 +35,20 @@ export const footerLinks: (t: ContextApi['t']) => FooterLinkType[] = (t) => [
label: 'Business',
items: [
{
label: t('Farms and Syrup Pools'),
label: t('CAKE Incentives'),
href: 'https://docs.pancakeswap.finance/ecosystem-and-partnerships/business-partnerships/syrup-pools-and-farms',
},
{
label: t('IFO'),
label: t('Staking Pools'),
href: 'https://pancakeswap.finance/pools',
},
{
label: t('Token Launches'),
href: 'https://docs.pancakeswap.finance/ecosystem-and-partnerships/business-partnerships/initial-farm-offerings-ifos',
},
{
label: t('NFT Marketplace'),
href: 'https://docs.pancakeswap.finance/ecosystem-and-partnerships/business-partnerships/nft-market-applications',
label: t('Brand Assets'),
href: 'https://docs.pancakeswap.finance/ecosystem-and-partnerships/brand',
},
],
},
Expand All @@ -68,7 +68,7 @@ export const footerLinks: (t: ContextApi['t']) => FooterLinkType[] = (t) => [
href: 'https://docs.pancakeswap.finance/developers/bug-bounty',
},
{
label: t('v4'),
label: t('V4'),
href: 'https://pancakeswap.finance/v4',
},
],
Expand All @@ -77,7 +77,7 @@ export const footerLinks: (t: ContextApi['t']) => FooterLinkType[] = (t) => [
label: t('Support'),
items: [
{
label: t('Contact'),
label: t('Get Help'),
href: 'https://docs.pancakeswap.finance/contact-us/customer-support',
},
{
Expand All @@ -88,27 +88,39 @@ export const footerLinks: (t: ContextApi['t']) => FooterLinkType[] = (t) => [
label: t('Documentation'),
href: 'https://docs.pancakeswap.finance/',
},
{
label: t('Audits'),
href: 'https://docs.pancakeswap.finance/readme/audits',
},
{
label: t('Legacy products'),
href: 'https://docs.pancakeswap.finance/products/legacy-products',
},
],
},
{
label: t('About'),
items: [
{
label: t('Terms Of Service'),
href: 'https://pancakeswap.finance/terms-of-service',
label: t('Tokenomics'),
href: 'https://docs.pancakeswap.finance/governance-and-tokenomics/cake-tokenomics',
},
{
label: t('Blog'),
href: 'https://blog.pancakeswap.finance/',
label: t('CAKE Emission Projection'),
href: 'https://analytics.pancakeswap.finance/',
},
{
label: t('Brand Assets'),
href: 'https://docs.pancakeswap.finance/ecosystem-and-partnerships/brand',
label: t('Blog'),
href: 'https://blog.pancakeswap.finance/',
},
{
label: t('Careers'),
href: 'https://docs.pancakeswap.finance/team/become-a-chef',
},
{
label: t('Terms Of Service'),
href: 'https://pancakeswap.finance/terms-of-service',
},
],
},
]
32 changes: 5 additions & 27 deletions apps/web/src/__tests__/utils/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ describe('getActiveMenuItem', () => {

it('should return an active item if pathname found in subitems', () => {
// Given
const pathname = '/pools'
const pathname = '/liquidity/pools'

// When
const result = getActiveMenuItem({ pathname, menuConfig: menuConfig(mockT, false, undefined) })

// Then
expect(result).toEqual(menuConfig(mockT, false, undefined)[2])
expect(result).toEqual(menuConfig(mockT, false, undefined)[1])
})

it('should not return an item that only includes pathname but not starts with', () => {
Expand All @@ -34,7 +34,7 @@ describe('getActiveMenuItem', () => {
const result = getActiveMenuItem({ pathname, menuConfig: menuConfig(mockT, false, undefined) })

// Then
expect(result).toEqual(menuConfig(mockT, false, undefined)[6])
expect(result).toEqual(menuConfig(mockT, false, undefined)[4])
})

it('should return undefined if item is not found', () => {
Expand Down Expand Up @@ -63,24 +63,13 @@ describe('getActiveSubMenuItem', () => {

it('should return an active sub item', () => {
// Given
const pathname = '/pools'
const pathname = '/liquidity/pools'

// When
const result = getActiveSubMenuItem({ pathname, menuItem: menuConfig(mockT, false, undefined)[1] })

// Then
expect(result).toEqual(menuConfig(mockT, false, undefined)[1].items?.[2])
})

it('should return the item with the longest href when multiple items are found', () => {
// Given
const pathname = '/nfts/collections/0xDf7952B35f24aCF7fC0487D01c8d5690a60DBa07'

// When
const result = getActiveSubMenuItem({ pathname, menuItem: menuConfig(mockT, false, undefined)[4] })

// Then
expect(result).toEqual(menuConfig(mockT, false, undefined)[4].items?.[1])
expect(result).toEqual(menuConfig(mockT, false, undefined)[1].items?.[0])
})

it('should return undefined if item is not found', () => {
Expand All @@ -94,16 +83,5 @@ describe('getActiveSubMenuItem', () => {
expect(result).toEqual(undefined)
})

it('should return the item with the longest href when multiple items are found', () => {
// Given
const pathname = '/nfts/collections/0xDf7952B35f24aCF7fC0487D01c8d5690a60DBa07'

// When
const result = getActiveSubMenuItem({ pathname, menuItem: menuConfig(mockT, false, undefined)[4] })

// Then
expect(result).toEqual(menuConfig(mockT, false, undefined)[4].items?.[1])
})

it.todo('should return items with supportChainId')
})
Loading
Loading