diff --git a/apps/tron/src/app/header.tsx b/apps/tron/src/app/header.tsx index 01c6426a21..0c9826752d 100644 --- a/apps/tron/src/app/header.tsx +++ b/apps/tron/src/app/header.tsx @@ -54,7 +54,7 @@ export const Navigation: FC = () => { Swap @@ -62,7 +62,7 @@ export const Navigation: FC = () => { Pool diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index deaebdc6b5..facb0089e7 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -7,7 +7,7 @@ const bundleAnalyzer = withBundleAnalyzer({ enabled: false && process.env.NODE_ENV !== 'development', }) -const FURO_URL = 'https://furo.sushi.com' +const FURO_URL = 'https://pay.sushi.com' /** @type {import('next').NextConfig} */ const nextConfig = bundleAnalyzer({ @@ -63,11 +63,26 @@ const nextConfig = bundleAnalyzer({ permanent: true, destination: '/pool/:path*', }, + { + source: '/aptos', + permanent: true, + destination: '/aptos/swap', + }, { source: '/skale/swap', permanent: true, destination: '/swap?chainId=2046399126', }, + { + source: '/furo', + permanent: true, + destination: `${FURO_URL}`, + }, + { + source: '/furo/:path*', + permanent: true, + destination: `${FURO_URL}/:path*`, + }, ] }, async rewrites() { @@ -94,14 +109,6 @@ const nextConfig = bundleAnalyzer({ // ], // destination: '/pay/:path*', // }, - { - source: '/furo', - destination: `${FURO_URL}/furo`, - }, - { - source: '/furo/:path*', - destination: `${FURO_URL}/furo/:path*`, - }, ] }, }) diff --git a/apps/web/src/app/(cms)/header.tsx b/apps/web/src/app/(cms)/header.tsx index 66469e80c3..5f177b4ca8 100644 --- a/apps/web/src/app/(cms)/header.tsx +++ b/apps/web/src/app/(cms)/header.tsx @@ -1,19 +1,11 @@ import { getDifficulties, getProducts } from '@sushiswap/graph-client/strapi' import { - EXPLORE_NAVIGATION_LINKS, - NavigationContainer, - NavigationListItem, - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, - // OnramperButton, - buttonVariants, + Navigation, + NavigationElement, + NavigationElementType, } from '@sushiswap/ui' -// import { getDifficulties, getProducts } from 'lib/api' import React from 'react' +import { EXPLORE_NAVIGATION_LINKS } from '../_common/header-elements' import { DOCS_URL } from './constants' interface HeaderLink { @@ -45,91 +37,49 @@ export async function Header() { : -1, ) - const navData: HeaderSection[] = [ - { title: 'Academy', href: '/academy' }, - { title: 'Blog', href: '/blog' }, + const navData: NavigationElement[] = [ + { + title: 'Explore', + items: EXPLORE_NAVIGATION_LINKS, + show: 'everywhere', + type: NavigationElementType.Dropdown, + }, + { + title: 'Academy', + href: '/academy', + show: 'everywhere', + type: NavigationElementType.Single, + }, + { + title: 'Blog', + href: '/blog', + show: 'everywhere', + type: NavigationElementType.Single, + }, { title: 'Products', - links: sortedProducts.map(({ longName, slug }) => ({ - name: longName, + items: sortedProducts.map(({ longName, slug }) => ({ + title: longName, href: `/academy/products/${slug}`, + description: '', })), - className: 'hidden md:flex', + show: 'desktop', + type: NavigationElementType.Dropdown, }, { title: 'Learn', - links: difficulties?.map(({ shortDescription, slug }) => { + items: difficulties?.map(({ shortDescription, slug }) => { const isTechnical = slug === 'technical' return { - name: shortDescription, + title: shortDescription, href: isTechnical ? DOCS_URL : `/academy/explore?difficulty=${slug}`, - isExternal: isTechnical, + description: '', } }), - className: 'hidden md:flex', + show: 'desktop', + type: NavigationElementType.Dropdown, }, ] - return ( - - - - - Explore - -
    - {EXPLORE_NAVIGATION_LINKS.map((component) => ( - - {component.description} - - ))} - {/* - - Need to buy some more crypto? - - */} -
-
-
- {navData.map(({ title, href, links, className }) => { - if (href && !links) { - return ( - - - {title} - - - ) - } - - return ( - - {title} - -
    - {links?.map(({ name, href }) => ( - - {name.split('-')?.[1]} - - ))} -
-
-
- ) - })} -
-
-
- ) + return } diff --git a/apps/web/src/app/(evm)/[chainId]/header.tsx b/apps/web/src/app/(evm)/[chainId]/header.tsx index 6c93565318..2b93fa8062 100644 --- a/apps/web/src/app/(evm)/[chainId]/header.tsx +++ b/apps/web/src/app/(evm)/[chainId]/header.tsx @@ -5,11 +5,13 @@ import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' import { useChainId } from 'wagmi' +import { headerElements } from '../_common/header-elements' export const Header: FC = () => { const chainId = useChainId() return ( } chainId={chainId} /> diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx new file mode 100644 index 0000000000..e0778c1a3f --- /dev/null +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -0,0 +1,68 @@ +import { + type NavigationElement, + NavigationElementDropdown, + NavigationElementType, + NavigationMenuLink, + OnramperButton, + navigationMenuTriggerStyle, +} from '@sushiswap/ui' +import { EXPLORE_NAVIGATION_LINKS } from 'src/app/_common/header-elements' + +const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Pay', + href: 'https://pay.sushi.com', + description: + 'Stream or create a vesting schedule with any ERC20 to any wallet.', + }, + { + title: 'Bonds', + href: 'https://sushi.com/bonds', + description: + 'Buy discounted tokens with vesting to support projects in a sustainable manner.', + }, +] + +export const headerElements: NavigationElement[] = [ + { + title: 'Explore', + items: EXPLORE_NAVIGATION_LINKS, + show: 'mobile', + type: NavigationElementType.Dropdown, + }, + { + title: 'Swap', + href: '/swap', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Pools', + href: '/explore/pool', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Stake', + href: '/stake', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + type: NavigationElementType.Custom, + item: ( + + + Buy Crypto + + + ), + show: 'desktop', + }, + { + title: 'More', + items: MORE_NAVIGATION_LINKS, + show: 'desktop', + type: NavigationElementType.Dropdown, + }, +] diff --git a/apps/web/src/app/(evm)/bonds/header.tsx b/apps/web/src/app/(evm)/bonds/header.tsx index d9062fdaeb..6ac316f610 100644 --- a/apps/web/src/app/(evm)/bonds/header.tsx +++ b/apps/web/src/app/(evm)/bonds/header.tsx @@ -4,10 +4,12 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { headerElements } from '../_common/header-elements' export const Header: FC = () => { return ( } /> ) diff --git a/apps/web/src/app/(evm)/claims/components/Header.tsx b/apps/web/src/app/(evm)/claims/components/Header.tsx index d9062fdaeb..699acc9391 100644 --- a/apps/web/src/app/(evm)/claims/components/Header.tsx +++ b/apps/web/src/app/(evm)/claims/components/Header.tsx @@ -4,10 +4,12 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { headerElements } from '../../_common/header-elements' export const Header: FC = () => { return ( } /> ) diff --git a/apps/web/src/app/(evm)/stake/header.tsx b/apps/web/src/app/(evm)/stake/header.tsx index d9062fdaeb..6ac316f610 100644 --- a/apps/web/src/app/(evm)/stake/header.tsx +++ b/apps/web/src/app/(evm)/stake/header.tsx @@ -4,10 +4,12 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { headerElements } from '../_common/header-elements' export const Header: FC = () => { return ( } /> ) diff --git a/apps/web/src/app/(evm)/swap/header.tsx b/apps/web/src/app/(evm)/swap/header.tsx index 6c93565318..2b93fa8062 100644 --- a/apps/web/src/app/(evm)/swap/header.tsx +++ b/apps/web/src/app/(evm)/swap/header.tsx @@ -5,11 +5,13 @@ import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' import { useChainId } from 'wagmi' +import { headerElements } from '../_common/header-elements' export const Header: FC = () => { const chainId = useChainId() return ( } chainId={chainId} /> diff --git a/apps/web/src/app/(landing)/header.tsx b/apps/web/src/app/(landing)/header.tsx index fefe7859bf..5423a222ab 100644 --- a/apps/web/src/app/(landing)/header.tsx +++ b/apps/web/src/app/(landing)/header.tsx @@ -1,125 +1,7 @@ 'use client' -import { - Button, - Container, - EXPLORE_NAVIGATION_LINKS, - LinkInternal, - NavigationContainer, - NavigationListItem, - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, - OnramperButton, - PARTNER_NAVIGATION_LINKS, - TOOLS_NAVIGATION_LINKS, - navigationMenuTriggerStyle, -} from '@sushiswap/ui' import React, { FC } from 'react' export const Header: FC = () => { - return ( - - - - - - Explore - -
    - {EXPLORE_NAVIGATION_LINKS.map((component) => ( - - {component.description} - - ))} - - - Need to buy some more crypto? - - -
-
-
- - - - Swap - - - - - - - Pools - - - - - - - Bonds - - - - - - - Stake - - - - - - - Pay - - - - - More - -
    - {TOOLS_NAVIGATION_LINKS.map((component) => ( - - {component.description} - - ))} -
-
-
- - Partners - -
    - {PARTNER_NAVIGATION_LINKS.map((component) => ( - - {component.description} - - ))} -
-
-
-
-
- - - -
-
- ) + return <> } diff --git a/apps/web/src/app/(non-evm)/aptos/(common)/lib/edge/use-is-swap-maintenance.ts b/apps/web/src/app/(non-evm)/aptos/(common)/lib/edge/use-is-swap-maintenance.ts index 2146774b2c..6fca6d3f20 100644 --- a/apps/web/src/app/(non-evm)/aptos/(common)/lib/edge/use-is-swap-maintenance.ts +++ b/apps/web/src/app/(non-evm)/aptos/(common)/lib/edge/use-is-swap-maintenance.ts @@ -8,7 +8,7 @@ export const useIsSwapMaintenance = () => { return useQuery({ queryKey: ['useIsSwapMaintenance'], queryFn: async () => { - const resp = await fetch('/api/config/swap', { + const resp = await fetch('/aptos/api/config/swap', { next: { revalidate: 60 }, }) const data = await resp.json() diff --git a/apps/web/src/app/(non-evm)/aptos/header.tsx b/apps/web/src/app/(non-evm)/aptos/header.tsx index 7e3c6cb9fe..292d709b65 100644 --- a/apps/web/src/app/(non-evm)/aptos/header.tsx +++ b/apps/web/src/app/(non-evm)/aptos/header.tsx @@ -1,15 +1,33 @@ 'use client' -import { Navigation } from '@sushiswap/ui' +import { + Navigation, + NavigationElement, + NavigationElementType, +} from '@sushiswap/ui' import React, { FC } from 'react' import { UserProfile } from './(common)/ui/user-profile/user-profile' +const nagivationElements: NavigationElement[] = [ + { + title: 'Swap', + href: '/aptos/swap', + show: 'everywhere', + type: NavigationElementType.Single, + }, + { + title: 'Pool', + href: '/aptos/pool', + show: 'everywhere', + type: NavigationElementType.Single, + }, +] + export const Header: FC = () => { return ( } /> ) diff --git a/apps/web/src/app/(non-evm)/aptos/pool/(landing)/layout.tsx b/apps/web/src/app/(non-evm)/aptos/pool/(landing)/layout.tsx index 93d02cb0e0..f3293409a3 100644 --- a/apps/web/src/app/(non-evm)/aptos/pool/(landing)/layout.tsx +++ b/apps/web/src/app/(non-evm)/aptos/pool/(landing)/layout.tsx @@ -22,20 +22,25 @@ export default function TabsLayout({ - + All Pools @@ -50,7 +55,7 @@ export default function TabsLayout({ My Rewards diff --git a/apps/web/src/app/(non-evm)/aptos/pool/hero.tsx b/apps/web/src/app/(non-evm)/aptos/pool/hero.tsx index 1901dd8a2c..5acef8fe01 100644 --- a/apps/web/src/app/(non-evm)/aptos/pool/hero.tsx +++ b/apps/web/src/app/(non-evm)/aptos/pool/hero.tsx @@ -32,7 +32,7 @@ export const Hero: FC = () => {
diff --git a/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/pools/PoolsTable.tsx b/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/pools/PoolsTable.tsx index 7a49c13e58..0b9c8201b2 100644 --- a/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/pools/PoolsTable.tsx +++ b/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/pools/PoolsTable.tsx @@ -44,7 +44,7 @@ export const PoolsTable = () => { // } = useNetwork() const rowLink = useCallback((row: PoolExtended) => { - return `/pool/${row.id}` + return `/aptos/pool/${row.id}` }, []) const filtered = useMemo(() => { diff --git a/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/positions/pool-positions-table.tsx b/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/positions/pool-positions-table.tsx index 03c0c3cedb..f89eb5c5fd 100644 --- a/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/positions/pool-positions-table.tsx +++ b/apps/web/src/app/(non-evm)/aptos/pool/ui/pools/tables/positions/pool-positions-table.tsx @@ -61,7 +61,7 @@ export const PositionsTable = () => { }, [pools, tokenSymbols]) const rowLink = useCallback((row: PoolExtended) => { - return `/pool/${row.id}` + return `/aptos/pool/${row.id}` }, []) const state: Partial = useMemo(() => { diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts new file mode 100644 index 0000000000..b5f92a3625 --- /dev/null +++ b/apps/web/src/app/_common/header-elements.ts @@ -0,0 +1,45 @@ +import type { NavigationElementDropdown } from '@sushiswap/ui' + +export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Swap', + href: '/swap', + description: 'The easiest way to trade.', + }, + { + title: 'Pools', + href: '/explore/pools', + description: 'Earn fees by providing liquidity.', + }, + { + title: 'Bonds', + href: '/bonds', + description: 'Earn interest by locking up your assets.', + }, + { + title: 'Stake', + href: '/stake', + description: 'Earn protocol fees by staking SUSHI.', + }, + { + title: 'Blog', + href: '/blog', + description: + 'Stay up to date with the latest product developments at Sushi.', + }, + { + title: 'Academy', + href: '/academy', + description: 'Everything you need to get up to speed with DeFi.', + }, + { + title: 'Partner with Sushi', + href: '/partner', + description: 'Incentivize your token with Sushi rewards.', + }, + { + title: 'List enquiry', + href: '/tokenlist-request', + description: 'Get your token on our default token list.', + }, +] diff --git a/apps/web/src/app/partner/layout.tsx b/apps/web/src/app/partner/layout.tsx new file mode 100644 index 0000000000..b7b5bddcd3 --- /dev/null +++ b/apps/web/src/app/partner/layout.tsx @@ -0,0 +1,16 @@ +import { Navigation } from '@sushiswap/ui' +import { Metadata } from 'next' +import { headerElements } from '../(evm)/_common/header-elements' + +export const metadata: Metadata = { + title: 'Partner', +} + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + +
{children}
+ + ) +} diff --git a/apps/web/src/app/privacy-policy/layout.tsx b/apps/web/src/app/privacy-policy/layout.tsx index 59eeae3e28..774cc651ee 100644 --- a/apps/web/src/app/privacy-policy/layout.tsx +++ b/apps/web/src/app/privacy-policy/layout.tsx @@ -1,9 +1,16 @@ +import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' +import { headerElements } from '../(evm)/_common/header-elements' export const metadata: Metadata = { title: 'Privacy Policy', } export default function Layout({ children }: { children: React.ReactNode }) { - return
{children}
+ return ( + <> + +
{children}
+ + ) } diff --git a/apps/web/src/app/terms-of-service/layout.tsx b/apps/web/src/app/terms-of-service/layout.tsx index a90584e6a3..ecf29a4e4d 100644 --- a/apps/web/src/app/terms-of-service/layout.tsx +++ b/apps/web/src/app/terms-of-service/layout.tsx @@ -1,9 +1,16 @@ +import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' +import { headerElements } from '../(evm)/_common/header-elements' export const metadata: Metadata = { title: 'Terms Of Service', } export default function Layout({ children }: { children: React.ReactNode }) { - return
{children}
+ return ( + <> + +
{children}
+ + ) } diff --git a/packages/sushi/src/config/subgraph/hosts.ts b/packages/sushi/src/config/subgraph/hosts.ts index e93678671a..cbf6962b2b 100644 --- a/packages/sushi/src/config/subgraph/hosts.ts +++ b/packages/sushi/src/config/subgraph/hosts.ts @@ -21,7 +21,8 @@ export const GOLDSKY_COMMUNITY_HOST = 'api.goldsky.com/api/public/project_cl8ylkiw00krx0hvza0qw17vn/subgraphs' export const WAGMI_METIS_HOST = 'metis.graph.wagmi.com/subgraphs/name' export const WAGMI_KAVA_HOST = 'kava.graph.wagmi.com/subgraphs/name' -export const METIS_0XGRAPH_HOST = 'metisapi.0xgraph.xyz/subgraphs/name' +export const METIS_0XGRAPH_HOST = + 'metisapi.0xgraph.xyz/api/public/fc1ae952-7a36-44ac-9e9b-f46d70cedf7d/subgraphs' export const SKALE_HOST = 'elated-tan-skat-graph.skalenodes.com:8000/subgraphs/name' diff --git a/packages/sushi/src/config/subgraph/subgraphs/sushiswap-v3.ts b/packages/sushi/src/config/subgraph/subgraphs/sushiswap-v3.ts index 010e03a5f9..25ede50235 100644 --- a/packages/sushi/src/config/subgraph/subgraphs/sushiswap-v3.ts +++ b/packages/sushi/src/config/subgraph/subgraphs/sushiswap-v3.ts @@ -29,13 +29,13 @@ export const SUSHISWAP_V3_SUBGRAPH_URL: Record = { [ChainId.LINEA]: `${DECENTRALIZED_HOST_BY_DEPLOYMENT_ID}/QmNZ9ePvxGRDHAEhb7cLsb3AvtCCPJ3qAwh1CDvDn39RMa`, [ChainId.SCROLL]: `${DECENTRALIZED_HOST_BY_DEPLOYMENT_ID}/QmR6VP1qoF8nxhtMaGEg9VMmkaTDFqyeM8nJWkakP6nHes`, [ChainId.ARBITRUM_NOVA]: `${SUSHI_DEDICATED_GOLDSKY_HOST}/sushi-v3/v3-arbitrum-nova/gn`, - [ChainId.THUNDERCORE]: `${THUNDERCORE_HOST}/sushi-v3/v3-thundercore`, - [ChainId.CORE]: `${CORE_HOST}/sushi-v3/v3-core-fix`, + [ChainId.THUNDERCORE]: `${THUNDERCORE_HOST}/sushi-v3/v3-thundercore-2`, + [ChainId.CORE]: `${CORE_HOST}/sushi-v3/v3-core-tvl-fix`, [ChainId.KAVA]: `${SUSHI_DEDICATED_GOLDSKY_HOST}/sushi-v3/v3-kava/gn`, - [ChainId.METIS]: `${METIS_0XGRAPH_HOST}/sushiswap/v3-metis`, + [ChainId.METIS]: `${METIS_0XGRAPH_HOST}/sushi-v3/v3-metis/v0.0.1/gn`, [ChainId.BTTC]: `${SUSHI_DEDICATED_GOLDSKY_HOST}/sushi-v3/v3-bttc/gn`, [ChainId.FILECOIN]: `${FILECOIN_HOST}/sushiswap/v3-filecoin`, - [ChainId.HAQQ]: `${HAQQ_HOST}/sushi/v3-haqq`, + [ChainId.HAQQ]: `${HAQQ_HOST}/sushi/v3-haqq-2`, [ChainId.ZETACHAIN]: `${SUSHI_GOLDSKY_HOST}/v3-zetachain/1.0.0/gn`, [ChainId.BLAST]: `${SUSHI_DEDICATED_GOLDSKY_HOST}/sushiswap/v3-blast/gn`, [ChainId.SKALE_EUROPA]: `${SKALE_HOST}/sushi/v3-skale-europa`, diff --git a/packages/sushi/src/config/wallet.ts b/packages/sushi/src/config/wallet.ts new file mode 100644 index 0000000000..16ae93542e --- /dev/null +++ b/packages/sushi/src/config/wallet.ts @@ -0,0 +1,72 @@ +import { ChainId } from '../chain/index.js' + +export const MULTISIG_CHAIN_IDS = [ + ChainId.ARBITRUM, + ChainId.AVALANCHE, + ChainId.BASE, + ChainId.BLAST, + ChainId.BOBA, + ChainId.BOBA_BNB, + ChainId.BSC, + ChainId.BTTC, + ChainId.CELO, + ChainId.CORE, + ChainId.ETHEREUM, + ChainId.FANTOM, + ChainId.FUSE, + ChainId.GNOSIS, + ChainId.HAQQ, + ChainId.HARMONY, + ChainId.KAVA, + ChainId.LINEA, + ChainId.METIS, + ChainId.MOONBEAM, + ChainId.MOONRIVER, + ChainId.OPTIMISM, + ChainId.POLYGON, + ChainId.POLYGON_ZKEVM, + ChainId.ROOTSTOCK, + ChainId.SCROLL, + ChainId.SKALE_EUROPA, + ChainId.TELOS, + ChainId.ZETACHAIN, +] as const + +export type MultisigChainId = (typeof MULTISIG_CHAIN_IDS)[number] + +export const MULTISIG_ADDRESS: Record = { + [ChainId.ARBITRUM]: '0x978982772b8e4055B921bf9295c0d74eB36Bc54e', + [ChainId.AVALANCHE]: '0x09842Ce338647906B686aBB3B648A6457fbB25DA', + [ChainId.BASE]: '0xFcD4e19Dd044cBa929cF1EEfc1C181aE4f5beCe8', + [ChainId.BLAST]: '0xbfF76182457256808BD11B0cAFc05C35c9E4aa43', + [ChainId.BOBA]: '0x3a131cd0A0F82c9610d7a90bBD4A924B1ccaa38E', + [ChainId.BOBA_BNB]: '0xb8f2faca5b2EBcd6Be7B5D9E164962dE9CCc3B76', + [ChainId.BSC]: '0xc6fD91aD4919Fd91e2c84077ba648092cB499638', + [ChainId.BTTC]: '0x488398D8EfeF84Bd3271f13ae8Eb44Cd2C1eE687', + [ChainId.CELO]: '0x751b01Fa14fD9640a1DF9014e2D0f3a03A198b81', + [ChainId.CORE]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.ETHEREUM]: '0x19B3Eb3Af5D93b77a5619b047De0EED7115A19e7', + [ChainId.FANTOM]: '0xF9E7d4c6d36ca311566f46c81E572102A2DC9F52', + [ChainId.FUSE]: '0x33b6beb37837459Ee84a1Ffed2C6a4ca22e5F316', + [ChainId.GNOSIS]: '0xc375411C6597F692Add6a7a3AD5b3C38626B0F26', + [ChainId.HAQQ]: '0x43a3f312c749B5D23Fc9547c39478b83b39362aA', + [ChainId.HARMONY]: '0x30af69A3f4a6f266961313Ce0943719dF4A8AA10', + [ChainId.KAVA]: '0xb8f2faca5b2EBcd6Be7B5D9E164962dE9CCc3B76', + [ChainId.LINEA]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.METIS]: '0xb8f2faca5b2EBcd6Be7B5D9E164962dE9CCc3B76', + [ChainId.MOONBEAM]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.MOONRIVER]: '0x939f7E76cc515cc296dD3ce362D9a52e148A7D5f', + [ChainId.OPTIMISM]: '0x1219Bfa3A499548507b4917E33F17439b67A2177', + [ChainId.POLYGON]: '0x850a57630A2012B2494779fBc86bBc24F2a7baeF', + [ChainId.POLYGON_ZKEVM]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.ROOTSTOCK]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.SCROLL]: '0x9ffC84bc9Cf7c85E4E6e2B0aB67BB6c643cA72A2', + [ChainId.SKALE_EUROPA]: '0xa88a0398C8D8B34Ab3f19CbBAbc2C4F33149Dfa6', + [ChainId.TELOS]: '0x72840af61A60B585064c16Ee402B3823366823Cb', + [ChainId.ZETACHAIN]: '0xb8f2faca5b2EBcd6Be7B5D9E164962dE9CCc3B76', +} as const + +export const isMultisigChainId = ( + chainId: ChainId, +): chainId is MultisigChainId => + MULTISIG_CHAIN_IDS.includes(chainId as MultisigChainId) diff --git a/packages/ui/src/components/navigation-menu.tsx b/packages/ui/src/components/navigation-menu.tsx index 665704e29c..5ae73ea8fe 100644 --- a/packages/ui/src/components/navigation-menu.tsx +++ b/packages/ui/src/components/navigation-menu.tsx @@ -42,7 +42,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName const NavigationMenuItem = NavigationMenuPrimitive.Item -const navigationMenuTriggerStyle = () => buttonVariants({ variant: 'ghost' }) +const navigationMenuTriggerStyle = buttonVariants({ variant: 'ghost' }) const NavigationMenuTrigger = React.forwardRef< React.ElementRef, @@ -51,7 +51,7 @@ const NavigationMenuTrigger = React.forwardRef< = ({ }) => { return (
-
{children}
@@ -153,81 +89,83 @@ const NavigationContainer: React.FC = ({ ) } -const navigationMenuItems = [ - { - title: 'Swap', - href: '/swap', - }, - { - title: 'Pools', - href: '/pool', - }, - { - title: 'Bonds', - href: '/bonds', - }, - { - title: 'Stake', - href: '/stake', - }, - { - title: 'More', - items: TOOLS_NAVIGATION_LINKS, - }, - { - title: 'Partners', - items: PARTNER_NAVIGATION_LINKS, - }, -] as const +export type NavigationElementShow = 'mobile' | 'desktop' | 'everywhere' + +const navigationElementShowMap: Record = { + mobile: 'md:hidden block', + desktop: 'md:block hidden', + everywhere: '', +} + +export enum NavigationElementType { + Single = 'single', + Dropdown = 'dropdown', + Custom = 'custom', +} + +export type NavigationElementSingle = { + title: string + href: string + show: NavigationElementShow + type: NavigationElementType.Single +} + +export type NavigationElementDropdown = { + title: string + items: { + title: string + href: string + description: string + }[] + show: NavigationElementShow + type: NavigationElementType.Dropdown +} + +export type NavigationElementCustom = { + item: React.ReactNode + show: NavigationElementShow + type: NavigationElementType.Custom +} + +export type NavigationElement = + | NavigationElementSingle + | NavigationElementDropdown + | NavigationElementCustom interface NavProps extends VariantProps { - leftElements?: (typeof navigationMenuItems)[number]['title'][] + leftElements: NavigationElement[] rightElement?: React.ReactNode - legacyBehavior?: boolean - showOnramper?: boolean chainId?: number } const Navigation: React.FC = ({ - leftElements: _leftElements = navigationMenuItems.map((entry) => entry.title), + leftElements: _leftElements, rightElement, variant, - legacyBehavior = false, }) => { const leftElements = React.useMemo(() => { - const SimpleItem = (entry: (typeof navigationMenuItems)[number]) => { - if (!('href' in entry)) { - throw new Error('Invalid entry') - } - + const SingleItem = (entry: NavigationElementSingle) => { return ( - - {legacyBehavior ? ( - - {entry.title} - - ) : ( - - {entry.title} - - )} + + + {entry.title} + ) } - const DropdownItem = (entry: (typeof navigationMenuItems)[number]) => { - if (!('items' in entry)) { - throw new Error('Invalid entry') - } - + const DropdownItem = (entry: NavigationElementDropdown) => { return ( - + {entry.title}
    @@ -236,7 +174,6 @@ const Navigation: React.FC = ({ key={component.title} title={component.title} href={component.href} - legacyBehavior={legacyBehavior} > {component.description} @@ -247,40 +184,82 @@ const Navigation: React.FC = ({ ) } - return _leftElements.map((el) => { - const entry = navigationMenuItems.find((entry) => entry.title === el)! - - if ('href' in entry) { - return SimpleItem(entry) - } else { - return DropdownItem(entry) + return _leftElements.flatMap((el) => { + switch (el.type) { + case NavigationElementType.Single: + return SingleItem(el) + case NavigationElementType.Dropdown: + return DropdownItem(el) + case NavigationElementType.Custom: + return ( +
    {el.item}
    + ) } }) - }, [_leftElements, legacyBehavior]) + }, [_leftElements]) return ( - - - - Explore - -
      - {EXPLORE_NAVIGATION_LINKS.map((component) => ( - - {component.description} - - ))} -
    -
    -
    - {leftElements} -
    -
    +
    + + + + + + + +
      +
      + Protocol +
      + {PROTOCOL_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
      +
      +
      + Partnership +
      + {PARTNER_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
      +
      +
      + Support +
      + {SUPPORT_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
      +
      +
    +
    +
    +
    +
    + + {leftElements} + +
    {rightElement ? rightElement : null}
    @@ -288,63 +267,49 @@ const Navigation: React.FC = ({ ) } -interface NavigationListItemProps extends React.ComponentPropsWithoutRef<'a'> { - legacyBehavior?: boolean -} +interface NavigationListItemProps extends React.ComponentPropsWithoutRef<'a'> {} const NavigationListItem = React.forwardRef< React.ElementRef<'a'>, NavigationListItemProps ->( - ( - { className, title, children, legacyBehavior = false, href, ...props }, - ref, - ) => { - return ( -
  • - - {legacyBehavior || !href ? ( - -
    {title}
    -

    - {children} -

    -
    - ) : ( - -
    {title}
    -

    - {children} -

    - - )} -
    -
  • - ) - }, -) +>(({ className, title, children, href, ...props }, ref) => { + return ( +
  • + + {!href ? ( + +
    {title}
    +

    + {children} +

    +
    + ) : ( + +
    {title}
    +

    + {children} +

    + + )} +
    +
  • + ) +}) NavigationListItem.displayName = 'NavListItem' -export { - EXPLORE_NAVIGATION_LINKS, - Navigation, - NavigationContainer, - NavigationListItem, - PARTNER_NAVIGATION_LINKS, - TOOLS_NAVIGATION_LINKS, -} +export { Navigation, NavigationContainer, NavigationListItem } diff --git a/packages/ui/src/icons/network/circle/EthereumCircle.tsx b/packages/ui/src/icons/network/circle/EthereumCircle.tsx index 18debd3522..7dafcf3817 100644 --- a/packages/ui/src/icons/network/circle/EthereumCircle.tsx +++ b/packages/ui/src/icons/network/circle/EthereumCircle.tsx @@ -2,12 +2,13 @@ import * as React from 'react' import { EthereumNaked } from '../naked/EthereumNaked' +import classNames from 'classnames' import { IconComponent } from '../../../types' export const EthereumCircle: IconComponent = (props) => ( } /> ) diff --git a/packages/ui/src/icons/network/circle/GnosisCircle.tsx b/packages/ui/src/icons/network/circle/GnosisCircle.tsx index 886a9a5e8d..096493a6fe 100644 --- a/packages/ui/src/icons/network/circle/GnosisCircle.tsx +++ b/packages/ui/src/icons/network/circle/GnosisCircle.tsx @@ -2,12 +2,13 @@ import * as React from 'react' import { GnosisNaked } from '../naked/GnosisNaked' +import classNames from 'classnames' import { IconComponent } from '../../../types' export const GnosisCircle: IconComponent = (props) => ( } /> ) diff --git a/packages/ui/src/icons/network/circle/TelosCircle.tsx b/packages/ui/src/icons/network/circle/TelosCircle.tsx index 37acb5a082..03025b297a 100644 --- a/packages/ui/src/icons/network/circle/TelosCircle.tsx +++ b/packages/ui/src/icons/network/circle/TelosCircle.tsx @@ -2,12 +2,13 @@ import * as React from 'react' import { TelosNaked } from '../naked/TelosNaked' +import classNames from 'classnames' import { IconComponent } from '../../../types' export const TelosCircle: IconComponent = (props) => ( } /> ) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32149cd7df..eeb3dc2a93 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22046,6 +22046,7 @@ packages: web3-provider-engine@14.2.1: resolution: {integrity: sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw==} + deprecated: 'This package has been deprecated, see the README for details: https://github.com/MetaMask/web3-provider-engine' web3-providers-http@1.10.3: resolution: {integrity: sha512-6dAgsHR3MxJ0Qyu3QLFlQEelTapVfWNTu5F45FYh8t7Y03T1/o+YAkVxsbY5AdmD+y5bXG/XPJ4q8tjL6MgZHw==}