diff --git a/apps/beets-frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/add-liquidity/[[...txHash]]/layout.tsx b/apps/beets-frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/add-liquidity/[[...txHash]]/layout.tsx
index 198c7d58d..b5f9d70e3 100644
--- a/apps/beets-frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/add-liquidity/[[...txHash]]/layout.tsx
+++ b/apps/beets-frontend-v3/app/(app)/pools/[chain]/[variant]/[id]/add-liquidity/[[...txHash]]/layout.tsx
@@ -13,6 +13,7 @@ import { usePoolRedirect } from '@repo/lib/modules/pool/pool.hooks'
import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
import { AddLiquidityProvider } from '@repo/lib/modules/pool/actions/add-liquidity/AddLiquidityProvider'
import { Permit2SignatureProvider } from '@repo/lib/modules/tokens/approvals/permit2/Permit2SignatureProvider'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
type Props = PropsWithChildren<{
params: { txHash?: string[] }
@@ -32,7 +33,7 @@ export default function AddLiquidityLayout({ params: { txHash }, children }: Pro
if (isNotSupported(pool)) {
return (
- This pool type is not currently supported in the Balancer V3 UI
+ {`This pool type is not currently supported in the ${PROJECT_CONFIG.projectName} UI`}
)
}
diff --git a/apps/beets-frontend-v3/app/(app)/pools/page.tsx b/apps/beets-frontend-v3/app/(app)/pools/page.tsx
index a07b73651..2549c3786 100644
--- a/apps/beets-frontend-v3/app/(app)/pools/page.tsx
+++ b/apps/beets-frontend-v3/app/(app)/pools/page.tsx
@@ -4,16 +4,13 @@ import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { Box, Skeleton } from '@chakra-ui/react'
import { Suspense } from 'react'
// import { getApolloServerClient } from '@repo/lib/shared/services/api/apollo-server.client'
-// import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
// import { GetFeaturedPoolsDocument } from '@repo/lib/shared/services/api/generated/graphql'
// import { FeaturedPools } from '@repo/lib/modules/featured-pools/FeaturedPools'
-import { PoolListDisplayType } from '@repo/lib/modules/pool/pool.types'
-import { GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
import { BeetsPromoBanner } from '@/lib/components/promos/BeetsPromoBanner'
export default async function PoolsPage() {
// Featured pools set up
- // const { supportedNetworks } = getProjectConfig()
+ // const { supportedNetworks } = useProjectConfig()
// const featuredPoolsQuery = await getApolloServerClient().query({
// query: GetFeaturedPoolsDocument,
@@ -46,16 +43,7 @@ export default async function PoolsPage() {
}>
-
+
diff --git a/apps/beets-frontend-v3/app/(app)/pools/sonic/page.tsx b/apps/beets-frontend-v3/app/(app)/pools/sonic/page.tsx
index 2dbfe2503..0483cba5f 100644
--- a/apps/beets-frontend-v3/app/(app)/pools/sonic/page.tsx
+++ b/apps/beets-frontend-v3/app/(app)/pools/sonic/page.tsx
@@ -1,10 +1,9 @@
import { BeetsPromoBanner } from '@/lib/components/promos/BeetsPromoBanner'
import { Box, Skeleton } from '@chakra-ui/react'
-import { PoolListDisplayType } from '@repo/lib/modules/pool/pool.types'
import { PoolList } from '@repo/lib/modules/pool/PoolList/PoolList'
import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
-import { GqlChain, GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
+import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
import { Suspense } from 'react'
export default function PoolsPage() {
@@ -19,21 +18,10 @@ export default function PoolsPage() {
-
}>
-
+
diff --git a/apps/beets-frontend-v3/app/(marketing)/page.tsx b/apps/beets-frontend-v3/app/(marketing)/page.tsx
index 2583a3a27..234576ca2 100644
--- a/apps/beets-frontend-v3/app/(marketing)/page.tsx
+++ b/apps/beets-frontend-v3/app/(marketing)/page.tsx
@@ -1,12 +1,12 @@
import { LandingPageLayout } from '@/lib/modules/landing-page/LandingPageLayout'
import { getApolloServerClient } from '@repo/lib/shared/services/api/apollo-server.client'
-import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
import { mins } from '@repo/lib/shared/utils/time'
import {
GetProtocolStatsDocument,
GetProtocolStatsPerChainDocument,
GqlChain,
} from '@repo/lib/shared/services/api/generated/graphql'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export default async function Home() {
const client = getApolloServerClient()
diff --git a/apps/beets-frontend-v3/app/layouts/base-layout.tsx b/apps/beets-frontend-v3/app/layouts/base-layout.tsx
index 5a52e8d5f..6732e51fe 100644
--- a/apps/beets-frontend-v3/app/layouts/base-layout.tsx
+++ b/apps/beets-frontend-v3/app/layouts/base-layout.tsx
@@ -2,8 +2,9 @@ import NextTopLoader from 'nextjs-toploader'
import { PropsWithChildren } from 'react'
import { NavBarContainer } from '@/lib/components/navs/NavBarContainer'
import { GlobalAlerts } from '@repo/lib/shared/components/navs/GlobalAlerts'
-import { FooterContainer } from '@/lib/components/footer/FooterContainer'
import { LzBeetsMigrateModal } from '@/lib/components/modals/LzBeetsMigrateModal'
+import { BeetsLogoType } from '@/lib/components/imgs/BeetsLogoType'
+import { Footer } from '@repo/lib/shared/components/navs/Footer'
export function BaseLayout({
children,
@@ -21,7 +22,11 @@ export function BaseLayout({
{children}
{renderLzBeetsModal && }
-
+ }
+ subTitle="Beets is your ultimate destination for liquid-staked tokens, real yield, and AMM innovation."
+ title="The Hub for LSTs"
+ />
)
}
diff --git a/apps/beets-frontend-v3/lib/components/footer/FooterContainer.tsx b/apps/beets-frontend-v3/lib/components/footer/FooterContainer.tsx
deleted file mode 100644
index a22e6c437..000000000
--- a/apps/beets-frontend-v3/lib/components/footer/FooterContainer.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { BeetsLogoType } from '../imgs/BeetsLogoType'
-import { useNavData } from '../navs/useNavData'
-import { useFooterData } from './useFooterData'
-import { Footer } from '@repo/lib/shared/components/navs/Footer'
-
-export function FooterContainer() {
- const { linkSections, legalLinks } = useFooterData()
- const { getSocialLinks } = useNavData()
-
- return (
- }
- socialLinks={getSocialLinks()}
- subTitle="Beets is your ultimate destination for liquid-staked tokens, real yield, and AMM innovation."
- title="The Hub for LSTs"
- />
- )
-}
diff --git a/apps/beets-frontend-v3/lib/components/footer/useFooterData.tsx b/apps/beets-frontend-v3/lib/components/footer/useFooterData.tsx
deleted file mode 100644
index ff568c08c..000000000
--- a/apps/beets-frontend-v3/lib/components/footer/useFooterData.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { LinkSection } from '@repo/lib/shared/components/navs/footer.types'
-
-export function useFooterData() {
- const linkSections: LinkSection[] = [
- {
- title: 'Build on Beets',
- links: [
- { label: 'Home', href: '/' },
-
- { label: 'Docs', href: 'https://docs.beets.fi', isExternal: true },
- {
- label: 'Prototype on v3',
- href: 'https://github.com/balancer/scaffold-balancer-v3',
- isExternal: true,
- },
- ],
- },
- {
- title: 'Use Beets protocol',
- links: [
- { label: 'Explore pools', href: '/pools' },
- { label: 'Swap tokens', href: '/swap' },
- { label: 'View portfolio', href: '/portfolio' },
- { label: 'Get maBEETS', href: 'https://ma.beets.fi', isExternal: true },
- ],
- },
- {
- title: 'Ecosystem',
- links: [
- { label: 'Governance', href: 'https://snapshot.org/#/beets.eth', isExternal: true },
- {
- label: 'Bug bounties',
- href: 'https://immunefi.com/bug-bounty/balancer',
- isExternal: true,
- },
- { label: 'Analytics', href: 'https://beets.defilytica.com', isExternal: true },
- ],
- },
- ]
-
- const legalLinks = [{ label: 'Terms of service', href: '/terms-of-service' }]
-
- return { linkSections, legalLinks }
-}
diff --git a/apps/beets-frontend-v3/lib/components/navs/NavBarContainer.tsx b/apps/beets-frontend-v3/lib/components/navs/NavBarContainer.tsx
index f43e79a2a..d9b5e077a 100644
--- a/apps/beets-frontend-v3/lib/components/navs/NavBarContainer.tsx
+++ b/apps/beets-frontend-v3/lib/components/navs/NavBarContainer.tsx
@@ -1,20 +1,22 @@
'use client'
-import { useNavData } from './useNavData'
import { NavBar, NavActions } from '@repo/lib/shared/components/navs/NavBar'
import { NavLogo } from './NavLogo'
import { MobileNav } from '@repo/lib/shared/components/navs/MobileNav'
import { useNav } from '@repo/lib/shared/components/navs/useNav'
import { BeetsLogoType } from '../imgs/BeetsLogoType'
import { Box, HStack } from '@chakra-ui/react'
-import { motion } from 'framer-motion'
+import { AnimatePresence, motion } from 'framer-motion'
import { fadeIn } from '@repo/lib/shared/utils/animations'
import { MaBeetsNavLink } from './MaBeetsNavLink'
import { SonicMigrationLink } from './SonicMigrationLink'
import { FantomToSonicSvg } from '../imgs/FantomToSonicSvg'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function NavBarContainer() {
- const { appLinks, ecosystemLinks, getSocialLinks } = useNavData()
+ const {
+ links: { appLinks, ecosystemLinks, socialLinks },
+ } = PROJECT_CONFIG
const { defaultAppLinks } = useNav()
const allAppLinks = [...defaultAppLinks, ...appLinks]
@@ -37,25 +39,33 @@ export function NavBarContainer() {
>
}
ecosystemLinks={ecosystemLinks}
- socialLinks={getSocialLinks()}
+ socialLinks={socialLinks}
/>
)
return (
-
-
-
-
-
-
-
- >
- }
- navLogo={}
- rightSlot={}
- />
+
+
+
+
+
+
+
+
+
+ >
+ }
+ navLogo={}
+ rightSlot={}
+ />
+
+
)
}
diff --git a/apps/beets-frontend-v3/lib/components/navs/PoolsLink.tsx b/apps/beets-frontend-v3/lib/components/navs/PoolsLink.tsx
deleted file mode 100644
index eb37f71f7..000000000
--- a/apps/beets-frontend-v3/lib/components/navs/PoolsLink.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import {
- Box,
- Button,
- Link,
- Popover,
- PopoverArrow,
- PopoverBody,
- PopoverCloseButton,
- PopoverContent,
- PopoverHeader,
- PopoverTrigger,
-} from '@chakra-ui/react'
-import { useNav } from '@repo/lib/shared/components/navs/useNav'
-import NextLink from 'next/link'
-
-function PoolNetworkLink({
- text,
- href,
- isLast,
- onClose,
-}: {
- text: string
- href: string
- isLast?: boolean
- onClose: () => void
-}) {
- return (
-
-
- {text}
-
-
- )
-}
-
-export function PoolsLink() {
- const { linkColorFor } = useNav()
-
- return (
-
- {({ onClose }) => (
- <>
-
-
-
-
-
-
- Select a network
-
-
-
-
-
-
- >
- )}
-
- )
-}
diff --git a/apps/beets-frontend-v3/lib/components/navs/useNavData.tsx b/apps/beets-frontend-v3/lib/components/navs/useNavData.tsx
deleted file mode 100644
index c1ac8804b..000000000
--- a/apps/beets-frontend-v3/lib/components/navs/useNavData.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { XIcon } from '@repo/lib/shared/components/icons/social/XIcon'
-import { DiscordIcon } from '@repo/lib/shared/components/icons/social/DiscordIcon'
-import { MediumIcon } from '@repo/lib/shared/components/icons/social/MediumIcon'
-import { GithubIcon } from '@repo/lib/shared/components/icons/social/GithubIcon'
-import { AppLink } from '@repo/lib/shared/components/navs/useNav'
-
-export function useNavData() {
- const appLinks: AppLink[] = [
- {
- href: '/stake',
- label: 'Stake $S',
- },
- ]
-
- const ecosystemLinks = [
- { label: 'Docs', href: 'https://docs.beets.fi/' },
- { label: 'Governance', href: 'https://snapshot.org/#/beets.eth' },
- { label: 'Analytics', href: 'https://beets.defilytica.com/' },
- ]
-
- const getSocialLinks = (size = 24) => [
- {
- icon: ,
- href: 'https://x.com/beets_fi',
- },
- {
- icon: ,
- href: 'https://beets.fi/discord',
- },
- {
- icon: ,
- href: 'https://beethovenxio.medium.com/',
- },
- {
- icon: ,
- href: 'https://github.com/beethovenxfi/',
- },
- ]
-
- return { appLinks, ecosystemLinks, getSocialLinks }
-}
diff --git a/apps/beets-frontend-v3/lib/modules/landing-page/sections/LandingBeetsSocialClub.tsx b/apps/beets-frontend-v3/lib/modules/landing-page/sections/LandingBeetsSocialClub.tsx
index 6d7af422e..f2fad1629 100644
--- a/apps/beets-frontend-v3/lib/modules/landing-page/sections/LandingBeetsSocialClub.tsx
+++ b/apps/beets-frontend-v3/lib/modules/landing-page/sections/LandingBeetsSocialClub.tsx
@@ -1,14 +1,15 @@
'use client'
-import { useNavData } from '@/lib/components/navs/useNavData'
import { Box, Center, HStack, IconButton, Link, Text } from '@chakra-ui/react'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
+import { SocialIcon } from '@repo/lib/shared/components/navs/SocialIcon'
import { AppLink } from '@repo/lib/shared/components/navs/useNav'
function SocialLinks({ socialLinks }: { socialLinks: AppLink[] }) {
return (
- {socialLinks.map(({ href, icon }) => (
+ {socialLinks.map(({ href, iconType }) => (
- {icon}
+
))}
@@ -30,8 +31,9 @@ function SocialLinks({ socialLinks }: { socialLinks: AppLink[] }) {
}
export function LandingBeetsSocialClub() {
- const { getSocialLinks } = useNavData()
- const socialLinks = getSocialLinks(36)
+ const {
+ links: { socialLinks },
+ } = PROJECT_CONFIG
return (
diff --git a/apps/frontend-v3/app/(app)/pools/cow/page.tsx b/apps/frontend-v3/app/(app)/pools/cow/page.tsx
index 501c359c1..c6095e214 100644
--- a/apps/frontend-v3/app/(app)/pools/cow/page.tsx
+++ b/apps/frontend-v3/app/(app)/pools/cow/page.tsx
@@ -37,7 +37,7 @@ export default function PoolsPage() {
}>
-
+
diff --git a/apps/frontend-v3/app/(app)/pools/page.tsx b/apps/frontend-v3/app/(app)/pools/page.tsx
index fc3ee30ec..6c2c85182 100644
--- a/apps/frontend-v3/app/(app)/pools/page.tsx
+++ b/apps/frontend-v3/app/(app)/pools/page.tsx
@@ -4,15 +4,13 @@ import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { Box, Skeleton } from '@chakra-ui/react'
import { Suspense } from 'react'
// import { getApolloServerClient } from '@repo/lib/shared/services/api/apollo-server.client'
-// import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
// import { GetFeaturedPoolsDocument } from '@repo/lib/shared/services/api/generated/graphql'
// import { FeaturedPools } from '@repo/lib/modules/featured-pools/FeaturedPools'
import { BoostedPoolsPromoBanner } from '@repo/lib/shared/components/promos/BoostedPoolsPromoBanner'
-import { GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
export default async function PoolsPage() {
// Featured pools set up
- // const { supportedNetworks } = getProjectConfig()
+ // const { supportedNetworks } = useProjectConfig()
// const featuredPoolsQuery = await getApolloServerClient().query({
// query: GetFeaturedPoolsDocument,
@@ -45,7 +43,7 @@ export default async function PoolsPage() {
}>
-
+
diff --git a/apps/frontend-v3/app/(marketing)/page.tsx b/apps/frontend-v3/app/(marketing)/page.tsx
index d8dc0a8dd..d426e0e79 100644
--- a/apps/frontend-v3/app/(marketing)/page.tsx
+++ b/apps/frontend-v3/app/(marketing)/page.tsx
@@ -2,13 +2,13 @@ import { getApolloServerClient } from '@repo/lib/shared/services/api/apollo-serv
import { LandingV3Layout } from './_lib/landing-v3/LandingV3Layout'
import { GetProtocolStatsDocument } from '@repo/lib/shared/services/api/generated/graphql'
import { mins } from '@repo/lib/shared/utils/time'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export default async function Home() {
const client = getApolloServerClient()
const variables = {
- chains: getProjectConfig().supportedNetworks,
+ chains: PROJECT_CONFIG.supportedNetworks,
}
const { data: protocolData } = await client.query({
diff --git a/apps/frontend-v3/app/layout.tsx b/apps/frontend-v3/app/layout.tsx
index 985c62e8c..00bfe2067 100644
--- a/apps/frontend-v3/app/layout.tsx
+++ b/apps/frontend-v3/app/layout.tsx
@@ -9,10 +9,11 @@ import { GlobalAlerts } from '@repo/lib/shared/components/navs/GlobalAlerts'
import { PropsWithChildren } from 'react'
import { Providers } from '@repo/lib/shared/components/site/providers'
import { NavBarContainer } from '@/lib/components/navs/NavBarContainer'
-import { FooterContainer } from '@/lib/components/footer/FooterContainer'
import { DEFAULT_THEME_COLOR_MODE } from '@repo/lib/shared/services/chakra/themes/base/foundations'
import { ThemeProvider as ColorThemeProvider } from 'next-themes'
import { ThemeProvider } from '@/lib/services/chakra/ThemeProvider'
+import { BalancerLogoType } from '@/lib/components/imgs/BalancerLogoType'
+import { Footer } from '@repo/lib/shared/components/navs/Footer'
export const metadata: Metadata = {
title: 'Balancer - DeFi Liquidity Pools',
@@ -54,7 +55,11 @@ export default function RootLayout({ children }: PropsWithChildren) {
{children}
-
+ }
+ subTitle="Balancer is a battle-tested toolkit for true AMM experimentation and innovation."
+ title="AMMs made easy"
+ />
diff --git a/apps/frontend-v3/lib/components/footer/FooterContainer.tsx b/apps/frontend-v3/lib/components/footer/FooterContainer.tsx
deleted file mode 100644
index 79087d799..000000000
--- a/apps/frontend-v3/lib/components/footer/FooterContainer.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { BalancerLogoType } from '../imgs/BalancerLogoType'
-import { useNavData } from '../navs/useNavData'
-import { useFooterData } from './useFooterData'
-import { Footer } from '@repo/lib/shared/components/navs/Footer'
-
-export function FooterContainer() {
- const { linkSections, legalLinks } = useFooterData()
- const { getSocialLinks } = useNavData()
-
- return (
- }
- socialLinks={getSocialLinks()}
- subTitle="Balancer is a battle-tested toolkit for true AMM experimentation and innovation."
- title="AMMs made easy"
- />
- )
-}
diff --git a/apps/frontend-v3/lib/components/footer/useFooterData.tsx b/apps/frontend-v3/lib/components/footer/useFooterData.tsx
deleted file mode 100644
index 4d57ed600..000000000
--- a/apps/frontend-v3/lib/components/footer/useFooterData.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { LinkSection } from '@repo/lib/shared/components/navs/footer.types'
-
-export function useFooterData() {
- const linkSections: LinkSection[] = [
- {
- title: 'Build on Balancer',
- links: [
- { label: 'Home', href: '/' },
- { label: 'v3 Docs', href: 'https://docs.balancer.fi', isExternal: true },
- {
- label: 'Prototype on v3',
- href: 'https://github.com/balancer/scaffold-balancer-v3',
- isExternal: true,
- },
- { label: 'Grants', href: 'https://grants.balancer.community', isExternal: true },
- { label: 'v2 Docs', href: 'https://docs-v2.balancer.fi', isExternal: true },
- ],
- },
- {
- title: 'Use Balancer protocol',
- links: [
- { label: 'Explore pools', href: '/pools' },
- { label: 'Swap tokens', href: '/swap' },
- { label: 'View portfolio', href: '/portfolio' },
- { label: 'Get veBAL', href: 'https://app.balancer.fi/#/vebal', isExternal: true },
- {
- label: 'Create an LBP',
- href: 'https://www.fjordfoundry.com/?utm_source=balancer&utm_medium=website',
- isExternal: true,
- },
- {
- label: 'Create an NFT drop',
- href: 'https://fjordnfts.com/?utm_source=balancer&utm_medium=website',
- isExternal: true,
- },
- ],
- },
- {
- title: 'Ecosystem',
- links: [
- { label: 'Forum', href: 'https://forum.balancer.fi', isExternal: true },
- { label: 'Governance', href: 'https://vote.balancer.fi', isExternal: true },
- {
- label: 'Bug bounties',
- href: 'https://immunefi.com/bug-bounty/balancer',
- isExternal: true,
- },
- { label: 'Dune Analytics', href: 'https://dune.com/balancer', isExternal: true },
- { label: 'Defilytica', href: 'https://balancer.defilytica.com', isExternal: true },
- {
- label: 'Brand assets',
- href: 'https://github.com/balancer/brand-assets',
- isExternal: true,
- },
- ],
- },
- ]
-
- const legalLinks = [
- { label: 'Terms of use', href: '/terms-of-use' },
- { label: 'Privacy policy', href: '/privacy-policy' },
- { label: 'Cookies policy', href: '/cookies-policy' },
- { label: '3rd party services', href: '/3rd-party-services' },
- { label: 'Risks', href: '/risks' },
- ]
-
- return { linkSections, legalLinks }
-}
diff --git a/apps/frontend-v3/lib/components/navs/NavBarContainer.tsx b/apps/frontend-v3/lib/components/navs/NavBarContainer.tsx
index 33a2584b0..3c3042ccc 100644
--- a/apps/frontend-v3/lib/components/navs/NavBarContainer.tsx
+++ b/apps/frontend-v3/lib/components/navs/NavBarContainer.tsx
@@ -1,7 +1,6 @@
'use client'
import { motion, AnimatePresence } from 'framer-motion'
-import { useNavData } from './useNavData'
import { NavBar } from '@repo/lib/shared/components/navs/NavBar'
import { NavLogo } from './NavLogo'
import { MobileNav } from '@repo/lib/shared/components/navs/MobileNav'
@@ -10,10 +9,24 @@ import { BalancerLogoType } from '../imgs/BalancerLogoType'
import { VeBalLink } from '@repo/lib/modules/vebal/VebalRedirectModal'
import { Box } from '@chakra-ui/react'
import { fadeIn } from '@repo/lib/shared/utils/animations'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
+import { isDev, isStaging } from '@repo/lib/config/app.config'
export function NavBarContainer() {
- const { appLinks, ecosystemLinks, getSocialLinks } = useNavData()
+ const {
+ links: { ecosystemLinks, socialLinks },
+ } = PROJECT_CONFIG
const { defaultAppLinks } = useNav()
+
+ // TODO: move vebal link to config when live
+ const appLinks = []
+ if (isDev || isStaging) {
+ appLinks.push({
+ label: 'veBAL (wip)',
+ href: '/vebal',
+ })
+ }
+
const allAppLinks = [...defaultAppLinks, ...appLinks]
return (
@@ -36,7 +49,7 @@ export function NavBarContainer() {
appLinks={allAppLinks}
customLinks={}
ecosystemLinks={ecosystemLinks}
- socialLinks={getSocialLinks()}
+ socialLinks={socialLinks}
/>
}
navLogo={}
diff --git a/apps/frontend-v3/lib/components/navs/useNavData.tsx b/apps/frontend-v3/lib/components/navs/useNavData.tsx
deleted file mode 100644
index 8790b5404..000000000
--- a/apps/frontend-v3/lib/components/navs/useNavData.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { XIcon } from '@repo/lib/shared/components/icons/social/XIcon'
-import { DiscordIcon } from '@repo/lib/shared/components/icons/social/DiscordIcon'
-import { MediumIcon } from '@repo/lib/shared/components/icons/social/MediumIcon'
-import { YoutubeIcon } from '@repo/lib/shared/components/icons/social/YoutubeIcon'
-import { GithubIcon } from '@repo/lib/shared/components/icons/social/GithubIcon'
-import { isDev, isStaging } from '@repo/lib/config/app.config'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
-
-export function useNavData() {
- const appLinks = []
-
- // To-do: Remove this when veBAL is live
- if (isDev || isStaging) {
- appLinks.push({
- label: 'veBAL (wip)',
- href: '/vebal',
- })
- }
-
- const ecosystemLinks = [
- { label: 'Build', href: 'https://balancer.fi/build' },
- { label: 'Blog', href: 'https://medium.com/balancer-protocol' },
- { label: 'Docs', href: 'https://docs.balancer.fi/' },
- { label: 'Governance', href: 'https://vote.balancer.fi/#/' },
- { label: 'Analytics', href: 'https://dune.com/balancer' },
- { label: 'Forum', href: 'https://forum.balancer.fi/' },
- {
- label: 'Grants',
- href: 'https://grants.balancer.community',
- },
- ]
-
- const getSocialLinks = (size = 24) => [
- {
- icon: ,
- href: 'https://x.com/Balancer',
- },
- {
- icon: ,
- href: getProjectConfig().externalLinks.discordUrl,
- },
- {
- icon: ,
- href: 'https://medium.com/balancer-protocol',
- },
- {
- icon: ,
- href: 'https://www.youtube.com/channel/UCBRHug6Hu3nmbxwVMt8x_Ow',
- },
- {
- icon: ,
- href: 'https://github.com/balancer/',
- },
- ]
-
- return { appLinks, ecosystemLinks, getSocialLinks }
-}
diff --git a/packages/lib/config/config.types.ts b/packages/lib/config/config.types.ts
index a68d352bf..4b01994a2 100644
--- a/packages/lib/config/config.types.ts
+++ b/packages/lib/config/config.types.ts
@@ -1,9 +1,11 @@
import { Address } from 'viem'
-import { GqlChain } from '../shared/services/api/generated/graphql'
+import { GqlChain, GqlPoolType } from '../shared/services/api/generated/graphql'
import { chains } from '@repo/lib/modules/web3/ChainConfig'
import { PoolIssue } from '../modules/pool/alerts/pool-issues/PoolIssue.type'
import { SupportedWrapHandler } from '../modules/swap/swap.types'
-import { PartnerVariant } from '../modules/pool/pool.types'
+import { PartnerVariant, PoolDisplayType } from '../modules/pool/pool.types'
+import { AppLink } from '../shared/components/navs/useNav'
+import { LinkSection } from '../shared/components/navs/footer.types'
export interface TokensConfig {
addresses: {
@@ -119,7 +121,24 @@ type VariantConfig = {
}
interface ExternalUrls {
- discordUrl: string
+ poolComposerUrl: string
+}
+
+type OptionsConfig = {
+ poolDisplayType: PoolDisplayType
+ hidePoolTags: string[]
+ hidePoolTypes: GqlPoolType[]
+ hideProtocolVersion: string[]
+ showPoolName: boolean
+ showVeBal: boolean
+ showMaBeets: boolean
+}
+
+type Links = {
+ appLinks: AppLink[]
+ ecosystemLinks: AppLink[]
+ socialLinks: AppLink[]
+ legalLinks: AppLink[]
}
export interface ProjectConfig {
@@ -132,4 +151,7 @@ export interface ProjectConfig {
ensNetwork: GqlChain
delegateOwner: Address
externalLinks: ExternalUrls
+ options: OptionsConfig
+ links: Links
+ footer: { linkSections: LinkSection[] }
}
diff --git a/packages/lib/config/getProjectConfig.ts b/packages/lib/config/getProjectConfig.ts
index 4f306a80e..11928c133 100644
--- a/packages/lib/config/getProjectConfig.ts
+++ b/packages/lib/config/getProjectConfig.ts
@@ -10,11 +10,3 @@ export const allProjects: Record = {
export const PROJECT_CONFIG = process.env.NEXT_PUBLIC_PROJECT_ID
? allProjects[process.env.NEXT_PUBLIC_PROJECT_ID]
: ProjectConfigBalancer
-
-export const isBeetsProject = PROJECT_CONFIG.projectId === 'beets'
-export const isBalancerProject = PROJECT_CONFIG.projectId === 'balancer'
-
-// TODO replace with just PROJECT_CONFIG everywhere
-export function getProjectConfig() {
- return PROJECT_CONFIG
-}
diff --git a/packages/lib/config/projects/balancer.ts b/packages/lib/config/projects/balancer.ts
index eabfac220..852eab003 100644
--- a/packages/lib/config/projects/balancer.ts
+++ b/packages/lib/config/projects/balancer.ts
@@ -1,6 +1,6 @@
import { ProjectConfig } from '@repo/lib/config/config.types'
-import { PartnerVariant } from '@repo/lib/modules/pool/pool.types'
-import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
+import { PartnerVariant, PoolDisplayType } from '@repo/lib/modules/pool/pool.types'
+import { GqlChain, GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
import { isProd } from '@repo/lib/config/app.config'
export const ProjectConfigBalancer: ProjectConfig = {
@@ -34,6 +34,115 @@ export const ProjectConfigBalancer: ProjectConfig = {
ensNetwork: GqlChain.Mainnet,
delegateOwner: '0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b',
externalLinks: {
- discordUrl: 'https://discord.balancer.fi/',
+ poolComposerUrl: 'https://pool-creator.balancer.fi',
+ },
+ options: {
+ poolDisplayType: PoolDisplayType.TokenPills,
+ hidePoolTags: [],
+ hidePoolTypes: [GqlPoolType.LiquidityBootstrapping, GqlPoolType.Fx],
+ hideProtocolVersion: [],
+ showPoolName: false,
+ showVeBal: true,
+ showMaBeets: false,
+ },
+ links: {
+ appLinks: [],
+ ecosystemLinks: [
+ { label: 'Build', href: 'https://balancer.fi/build' },
+ { label: 'Blog', href: 'https://medium.com/balancer-protocol' },
+ { label: 'Docs', href: 'https://docs.balancer.fi/' },
+ { label: 'Governance', href: 'https://vote.balancer.fi/#/' },
+ { label: 'Analytics', href: 'https://dune.com/balancer' },
+ { label: 'Forum', href: 'https://forum.balancer.fi/' },
+ {
+ label: 'Grants',
+ href: 'https://grants.balancer.community',
+ },
+ ],
+ socialLinks: [
+ {
+ iconType: 'x',
+ href: 'https://x.com/Balancer',
+ },
+ {
+ iconType: 'discord',
+ href: 'https://discord.balancer.fi/',
+ },
+ {
+ iconType: 'medium',
+ href: 'https://medium.com/balancer-protocol',
+ },
+ {
+ iconType: 'youtube',
+ href: 'https://www.youtube.com/channel/UCBRHug6Hu3nmbxwVMt8x_Ow',
+ },
+ {
+ iconType: 'github',
+ href: 'https://github.com/balancer/',
+ },
+ ],
+ legalLinks: [
+ { label: 'Terms of use', href: '/terms-of-use' },
+ { label: 'Privacy policy', href: '/privacy-policy' },
+ { label: 'Cookies policy', href: '/cookies-policy' },
+ { label: '3rd party services', href: '/3rd-party-services' },
+ { label: 'Risks', href: '/risks' },
+ ],
+ },
+ footer: {
+ linkSections: [
+ {
+ title: 'Build on Balancer',
+ links: [
+ { label: 'Home', href: '/' },
+ { label: 'v3 Docs', href: 'https://docs.balancer.fi', isExternal: true },
+ {
+ label: 'Prototype on v3',
+ href: 'https://github.com/balancer/scaffold-balancer-v3',
+ isExternal: true,
+ },
+ { label: 'Grants', href: 'https://grants.balancer.community', isExternal: true },
+ { label: 'v2 Docs', href: 'https://docs-v2.balancer.fi', isExternal: true },
+ ],
+ },
+ {
+ title: 'Use Balancer protocol',
+ links: [
+ { label: 'Explore pools', href: '/pools' },
+ { label: 'Swap tokens', href: '/swap' },
+ { label: 'View portfolio', href: '/portfolio' },
+ { label: 'Get veBAL', href: 'https://app.balancer.fi/#/vebal', isExternal: true },
+ {
+ label: 'Create an LBP',
+ href: 'https://www.fjordfoundry.com/?utm_source=balancer&utm_medium=website',
+ isExternal: true,
+ },
+ {
+ label: 'Create an NFT drop',
+ href: 'https://fjordnfts.com/?utm_source=balancer&utm_medium=website',
+ isExternal: true,
+ },
+ ],
+ },
+ {
+ title: 'Ecosystem',
+ links: [
+ { label: 'Forum', href: 'https://forum.balancer.fi', isExternal: true },
+ { label: 'Governance', href: 'https://vote.balancer.fi', isExternal: true },
+ {
+ label: 'Bug bounties',
+ href: 'https://immunefi.com/bug-bounty/balancer',
+ isExternal: true,
+ },
+ { label: 'Dune Analytics', href: 'https://dune.com/balancer', isExternal: true },
+ { label: 'Defilytica', href: 'https://balancer.defilytica.com', isExternal: true },
+ {
+ label: 'Brand assets',
+ href: 'https://github.com/balancer/brand-assets',
+ isExternal: true,
+ },
+ ],
+ },
+ ],
},
}
diff --git a/packages/lib/config/projects/beets.ts b/packages/lib/config/projects/beets.ts
index 2796c7a27..5d772be33 100644
--- a/packages/lib/config/projects/beets.ts
+++ b/packages/lib/config/projects/beets.ts
@@ -1,5 +1,6 @@
import { ProjectConfig } from '@repo/lib/config/config.types'
-import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
+import { PoolDisplayType } from '@repo/lib/modules/pool/pool.types'
+import { GqlChain, GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
export const beetsSupportedNetworks = [GqlChain.Optimism, GqlChain.Sonic]
// as const satisifies GqlChain[]
@@ -13,6 +14,85 @@ export const ProjectConfigBeets: ProjectConfig = {
ensNetwork: GqlChain.Sonic,
delegateOwner: '0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b', // TODO update this for sonic & optimism,
externalLinks: {
- discordUrl: 'https://beets.fi/discord',
+ poolComposerUrl: 'https://ma.beets.fi/compose',
+ },
+ options: {
+ poolDisplayType: PoolDisplayType.Name,
+ hidePoolTags: ['VE8020', 'BOOSTED'],
+ hidePoolTypes: [GqlPoolType.LiquidityBootstrapping, GqlPoolType.CowAmm, GqlPoolType.Fx],
+ hideProtocolVersion: ['cow', 'v3'],
+ showPoolName: true,
+ showVeBal: false,
+ showMaBeets: true,
+ },
+ links: {
+ appLinks: [
+ {
+ href: '/stake',
+ label: 'Stake $S',
+ },
+ ],
+ ecosystemLinks: [
+ { label: 'Docs', href: 'https://docs.beets.fi/' },
+ { label: 'Governance', href: 'https://snapshot.org/#/beets.eth' },
+ { label: 'Analytics', href: 'https://beets.defilytica.com/' },
+ ],
+ socialLinks: [
+ {
+ iconType: 'x',
+ href: 'https://x.com/beets_fi',
+ },
+ {
+ iconType: 'discord',
+ href: 'https://beets.fi/discord',
+ },
+ {
+ iconType: 'medium',
+ href: 'https://beethovenxio.medium.com/',
+ },
+ {
+ iconType: 'github',
+ href: 'https://github.com/beethovenxfi/',
+ },
+ ],
+ legalLinks: [{ label: 'Terms of service', href: '/terms-of-service' }],
+ },
+ footer: {
+ linkSections: [
+ {
+ title: 'Build on Beets',
+ links: [
+ { label: 'Home', href: '/' },
+
+ { label: 'Docs', href: 'https://docs.beets.fi', isExternal: true },
+ {
+ label: 'Prototype on v3',
+ href: 'https://github.com/balancer/scaffold-balancer-v3',
+ isExternal: true,
+ },
+ ],
+ },
+ {
+ title: 'Use Beets protocol',
+ links: [
+ { label: 'Explore pools', href: '/pools' },
+ { label: 'Swap tokens', href: '/swap' },
+ { label: 'View portfolio', href: '/portfolio' },
+ { label: 'Get maBEETS', href: 'https://ma.beets.fi', isExternal: true },
+ ],
+ },
+ {
+ title: 'Ecosystem',
+ links: [
+ { label: 'Governance', href: 'https://snapshot.org/#/beets.eth', isExternal: true },
+ {
+ label: 'Bug bounties',
+ href: 'https://immunefi.com/bug-bounty/balancer',
+ isExternal: true,
+ },
+ { label: 'Analytics', href: 'https://beets.defilytica.com', isExternal: true },
+ ],
+ },
+ ],
},
}
diff --git a/packages/lib/config/useNetworkConfig.ts b/packages/lib/config/useNetworkConfig.ts
index 2c58a257f..d882ec0d2 100644
--- a/packages/lib/config/useNetworkConfig.ts
+++ b/packages/lib/config/useNetworkConfig.ts
@@ -8,6 +8,11 @@ export function useNetworkConfig() {
let defaultNetwork
const { chain } = useUserAccount()
+ const projectDefaultNetwork = PROJECT_CONFIG.defaultNetwork
+
+ if (!chain) {
+ defaultNetwork = projectDefaultNetwork
+ }
if (!chain) {
defaultNetwork = PROJECT_CONFIG.defaultNetwork
diff --git a/packages/lib/modules/chains/ChainSelect.tsx b/packages/lib/modules/chains/ChainSelect.tsx
index b31adc188..18d66fce2 100644
--- a/packages/lib/modules/chains/ChainSelect.tsx
+++ b/packages/lib/modules/chains/ChainSelect.tsx
@@ -1,7 +1,6 @@
'use client'
import { getChainShortName } from '@repo/lib/config/app.config'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { NetworkIcon } from '@repo/lib/shared/components/icons/NetworkIcon'
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
import { getSelectStyles } from '@repo/lib/shared/services/chakra/custom/chakra-react-select'
@@ -18,6 +17,7 @@ import { ReactNode, useEffect, useState } from 'react'
import { ChevronDown, Globe } from 'react-feather'
import { motion } from 'framer-motion'
import { pulseOnceWithDelay } from '@repo/lib/shared/utils/animations'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
interface ChainOption extends OptionBase {
label: ReactNode
@@ -29,7 +29,7 @@ type Props = {
onChange(value: GqlChain): void
}
-const networkOptions: ChainOption[] = getProjectConfig().supportedNetworks.map(network => ({
+const networkOptions: ChainOption[] = PROJECT_CONFIG.supportedNetworks.map(network => ({
label: (
@@ -54,12 +54,14 @@ function DropdownIndicator({
export function ChainSelect({ value, onChange }: Props) {
const [chainValue, setChainValue] = useState(undefined)
+
const chakraStyles = getSelectStyles()
function handleChange(newOption: SingleValue) {
if (newOption) onChange(newOption.value)
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => setChainValue(networkOptions.find(option => option.value === value)), [value])
return (
diff --git a/packages/lib/modules/marketing/useEcosystemPoolActivity.tsx b/packages/lib/modules/marketing/useEcosystemPoolActivity.tsx
index 198c0621e..aa725be27 100644
--- a/packages/lib/modules/marketing/useEcosystemPoolActivity.tsx
+++ b/packages/lib/modules/marketing/useEcosystemPoolActivity.tsx
@@ -10,18 +10,17 @@ import { ColorMode, useTheme as useChakraTheme } from '@chakra-ui/react'
import { useTheme as useNextTheme } from 'next-themes'
import { abbreviateAddress } from '@repo/lib/shared/utils/addresses'
import { useTokens } from '@repo/lib/modules/tokens/TokensProvider'
-
import { useBreakpoints } from '@repo/lib/shared/hooks/useBreakpoints'
import { useCurrency } from '@repo/lib/shared/hooks/useCurrency'
import { NumberFormatter } from '@repo/lib/shared/utils/numbers'
import { usePoolEvents } from '../pool/usePoolEvents'
-import { supportedNetworks } from '../web3/ChainConfig'
import { getChainShortName } from '@repo/lib/config/app.config'
import { ApiToken } from '../tokens/token.types'
import {
getBlockExplorerAddressUrl,
getBlockExplorerTxUrl,
} from '@repo/lib/shared/utils/blockExplorer'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
type ChartInfoTokens = {
token?: ApiToken
@@ -320,9 +319,10 @@ export function useEcosystemPoolActivityChart() {
const { toCurrency } = useCurrency()
const [activeTab, setActiveTab] = useState(tabsList[0])
const [activeNetwork, setActiveNetwork] = useState('all')
-
const theme = useChakraTheme()
+ const { supportedNetworks } = PROJECT_CONFIG
+
const { loading, data: response } = usePoolEvents({
first: 500,
chainIn: supportedNetworks,
diff --git a/packages/lib/modules/pool/PoolDetail/PoolActivityTable/PoolActivityTableRow.tsx b/packages/lib/modules/pool/PoolDetail/PoolActivityTable/PoolActivityTableRow.tsx
index 85abaec39..9756bd8cf 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolActivityTable/PoolActivityTableRow.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolActivityTable/PoolActivityTableRow.tsx
@@ -26,11 +26,11 @@ import { fNum } from '@repo/lib/shared/utils/numbers'
import React from 'react'
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
import { usePool } from '../../PoolProvider'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import {
getBlockExplorerAddressUrl,
getBlockExplorerTxUrl,
} from '@repo/lib/shared/utils/blockExplorer'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
interface Props extends GridProps {
event: PoolActivityEl
@@ -38,7 +38,7 @@ interface Props extends GridProps {
}
function EnsOrAddress({ userAddress, chain }: { userAddress: `0x${string}`; chain: GqlChain }) {
- const chainId = getChainId(getProjectConfig().ensNetwork) // perform ENS lookup through ensNetwork
+ const chainId = getChainId(PROJECT_CONFIG.ensNetwork) // perform ENS lookup through ensNetwork
const { data: name } = useEnsName({ address: userAddress, chainId })
const { data: ensAvatar } = useEnsAvatar({
diff --git a/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolBreadcrumbs.tsx b/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolBreadcrumbs.tsx
index f0271591b..57bace55d 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolBreadcrumbs.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolBreadcrumbs.tsx
@@ -2,7 +2,7 @@ import { Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button } from '@chakra
import { usePool } from '../../PoolProvider'
import { ChevronRight, Home } from 'react-feather'
import { isCowAmmPool } from '../../pool.helpers'
-import { isBeetsProject } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function PoolBreadcrumbs() {
const { pool } = usePool()
@@ -32,7 +32,9 @@ export function PoolBreadcrumbs() {
{poolsLabel}
- {isBeetsProject ? pool.name : pool.symbol}
+
+ {PROJECT_CONFIG.options.showPoolName ? pool.name : pool.symbol}
+
)
diff --git a/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolSwapFees.tsx b/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolSwapFees.tsx
index f9beeec7d..615014ba1 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolSwapFees.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolHeader/PoolSwapFees.tsx
@@ -14,10 +14,11 @@ import { Repeat } from 'react-feather'
import { Pool } from '../../pool.types'
import { shouldCallComputeDynamicSwapFee } from '../../pool.utils'
import { FluidIcon } from '@repo/lib/shared/components/icons/FluidIcon'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function PoolSwapFees({ pool }: { pool: Pool }) {
const isDynamicSwapFee = shouldCallComputeDynamicSwapFee(pool)
+
return (
{({ isOpen }) => (
@@ -61,7 +62,7 @@ export function PoolSwapFees({ pool }: { pool: Pool }) {
) : (
- {`This pool has a dynamic fee rate that may be updated through ${getProjectConfig().projectName} governance.`}
+ {`This pool has a dynamic fee rate that may be updated through ${PROJECT_CONFIG.projectName} governance.`}
)}
diff --git a/packages/lib/modules/pool/PoolDetail/PoolInfo/PoolAttributes/useFormattedPoolAttributes.tsx b/packages/lib/modules/pool/PoolDetail/PoolInfo/PoolAttributes/useFormattedPoolAttributes.tsx
index b87e49180..5f413c43a 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolInfo/PoolAttributes/useFormattedPoolAttributes.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolInfo/PoolAttributes/useFormattedPoolAttributes.tsx
@@ -10,9 +10,9 @@ import { isBoosted, isCowAmmPool, isStable, isV2Pool, isV3Pool } from '../../../
import { useCurrency } from '@repo/lib/shared/hooks/useCurrency'
import { getPoolTypeLabel, shouldHideSwapFee } from '../../../pool.utils'
import { useTokens } from '@repo/lib/modules/tokens/TokensProvider'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { compact } from 'lodash'
import { getBlockExplorerAddressUrl } from '@repo/lib/shared/utils/blockExplorer'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
type FormattedPoolAttributes = {
title: string
@@ -25,9 +25,9 @@ export function useFormattedPoolAttributes() {
const { toCurrency } = useCurrency()
const { usdValueForBpt } = useTokens()
- const { delegateOwner } = getProjectConfig()
const isV2 = isV2Pool(pool)
const isV3 = isV3Pool(pool)
+ const delegateOwner = PROJECT_CONFIG.delegateOwner
const poolOwnerData = useMemo(() => {
if (!pool) return
diff --git a/packages/lib/modules/pool/PoolDetail/PoolMyLiquidity.tsx b/packages/lib/modules/pool/PoolDetail/PoolMyLiquidity.tsx
index c4a5cbdd5..ae8b016ea 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolMyLiquidity.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolMyLiquidity.tsx
@@ -42,7 +42,6 @@ import {
calcGaugeStakedBalance,
} from '../user-balance.helpers'
import { isVebalPool, shouldBlockAddLiquidity, calcUserShareOfPool, isFx } from '../pool.helpers'
-
import { getCanStake, migrateStakeTooltipLabel } from '../actions/stake.helpers'
import { InfoOutlineIcon } from '@chakra-ui/icons'
import { GqlPoolStakingType } from '@repo/lib/shared/services/api/generated/graphql'
diff --git a/packages/lib/modules/pool/PoolDetail/PoolStats/PoolSnapshot/PoolSnapshotValues.tsx b/packages/lib/modules/pool/PoolDetail/PoolStats/PoolSnapshot/PoolSnapshotValues.tsx
index add2754be..103971ed7 100644
--- a/packages/lib/modules/pool/PoolDetail/PoolStats/PoolSnapshot/PoolSnapshotValues.tsx
+++ b/packages/lib/modules/pool/PoolDetail/PoolStats/PoolSnapshot/PoolSnapshotValues.tsx
@@ -80,6 +80,7 @@ export function PoolSnapshotValues() {
([])
const { toCurrency } = useCurrency()
- const isVeBal = pool.staking?.type === GqlPoolStakingType.Vebal
+ const {
+ options: { showVeBal },
+ } = PROJECT_CONFIG
+
+ const isVeBalPoolStaking = pool.staking?.type === GqlPoolStakingType.Vebal
const showBoostValue =
- pool.staking?.type === GqlPoolStakingType.Gauge && !isVeBal && isBalancerProject
+ pool.staking?.type === GqlPoolStakingType.Gauge && !isVeBalPoolStaking && showVeBal
// keep this card the same height as the 'My liquidity' section
useLayoutEffect(() => {
@@ -204,7 +208,7 @@ export default function PoolUserEvents({
}, [userPoolEvents, isLoading])
function getShareTitle() {
- if (isVeBal) {
+ if (showVeBal) {
return 'locked'
}
diff --git a/packages/lib/modules/pool/PoolList/PoolList.tsx b/packages/lib/modules/pool/PoolList/PoolList.tsx
index a0f602c93..a4ff7a4de 100644
--- a/packages/lib/modules/pool/PoolList/PoolList.tsx
+++ b/packages/lib/modules/pool/PoolList/PoolList.tsx
@@ -1,32 +1,16 @@
import { PoolListProvider } from '@repo/lib/modules/pool/PoolList/PoolListProvider'
import { PoolListLayout } from './PoolListLayout'
import { GqlPoolType, GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
-import { PoolListDisplayType } from '../pool.types'
export async function PoolList({
fixedPoolTypes,
- displayType = PoolListDisplayType.TokenPills,
- hideProtocolVersion = [],
- hidePoolTypes = [],
- hidePoolTags = [],
fixedChains,
}: {
- displayType?: PoolListDisplayType
fixedPoolTypes?: GqlPoolType[]
- hideProtocolVersion?: string[]
- hidePoolTypes?: GqlPoolType[]
- hidePoolTags?: string[]
fixedChains?: GqlChain[]
}) {
return (
-
+
)
diff --git a/packages/lib/modules/pool/PoolList/PoolListFilters.tsx b/packages/lib/modules/pool/PoolList/PoolListFilters.tsx
index c56ce6489..e3a8b9c2d 100644
--- a/packages/lib/modules/pool/PoolList/PoolListFilters.tsx
+++ b/packages/lib/modules/pool/PoolList/PoolListFilters.tsx
@@ -31,7 +31,6 @@ import {
VStack,
} from '@chakra-ui/react'
import { PoolListSearch } from './PoolListSearch'
-import { getProjectConfig, isBeetsProject } from '@repo/lib/config/getProjectConfig'
import { PROTOCOL_VERSION_TABS } from './usePoolListQueryState'
import { PoolFilterType, poolTagFilters, PoolTagType, poolTypeFilters } from '../pool.types'
import { useUserAccount } from '@repo/lib/modules/web3/UserAccountProvider'
@@ -53,6 +52,7 @@ import ButtonGroup, {
} from '@repo/lib/shared/components/btns/button-group/ButtonGroup'
import { useCow } from '../../cow/useCow'
import Link from 'next/link'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
const SLIDER_MAX_VALUE = 10000000
const SLIDER_STEP_SIZE = 100000
@@ -97,10 +97,9 @@ function UserPoolFilter() {
)
}
-function PoolCategoryFilters() {
+function PoolCategoryFilters({ hidePoolTags }: { hidePoolTags: string[] }) {
const {
queryState: { togglePoolTag, poolTags, setPoolTags, poolTagLabel },
- hidePoolTags,
} = usePoolList()
// remove query param when empty
@@ -113,7 +112,7 @@ function PoolCategoryFilters() {
return (
{poolTagFilters
- .filter(tag => !hidePoolTags.includes(tag))
+ .filter(tag => !hidePoolTags?.includes(tag))
.map(tag => (
@@ -629,7 +626,7 @@ export function PoolListFilters() {
Pool categories
-
+
diff --git a/packages/lib/modules/pool/PoolList/PoolListPoolDisplay.tsx b/packages/lib/modules/pool/PoolList/PoolListPoolDisplay.tsx
new file mode 100644
index 000000000..a665202b9
--- /dev/null
+++ b/packages/lib/modules/pool/PoolList/PoolListPoolDisplay.tsx
@@ -0,0 +1,36 @@
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
+import { ExpandedPoolInfo } from '../../portfolio/PortfolioTable/useExpandedPools'
+import { PoolDisplayType, PoolListItem } from '../pool.types'
+import { PoolListPoolName } from './PoolListPoolName'
+import { PoolListTokenPills } from './PoolListTokenPills'
+
+export function PoolListPoolDisplay({
+ pool,
+ name,
+}: {
+ pool: PoolListItem | ExpandedPoolInfo
+ name: string | undefined
+}) {
+ let component
+
+ switch (PROJECT_CONFIG.options.poolDisplayType) {
+ case PoolDisplayType.Name:
+ component =
+ break
+ case PoolDisplayType.TokenPills:
+ default:
+ component = (
+
+ )
+ break
+ }
+
+ return component
+}
diff --git a/packages/lib/modules/pool/PoolList/PoolListPoolName.tsx b/packages/lib/modules/pool/PoolList/PoolListPoolName.tsx
new file mode 100644
index 000000000..9d11c476d
--- /dev/null
+++ b/packages/lib/modules/pool/PoolList/PoolListPoolName.tsx
@@ -0,0 +1,30 @@
+import { Box, HStack, Text } from '@chakra-ui/react'
+import { TokenIcon } from '../../tokens/TokenIcon'
+import { PoolListItem } from '../pool.types'
+import { ExpandedPoolInfo } from '../../portfolio/PortfolioTable/useExpandedPools'
+import { getUserReferenceTokens } from '../pool-tokens.utils'
+
+export function PoolListPoolName({ pool }: { pool: PoolListItem | ExpandedPoolInfo }) {
+ const isFirstToken = (index: number) => index === 0
+ const displayTokens = getUserReferenceTokens(pool)
+ const zIndices = Array.from({ length: displayTokens.length }, (_, index) => index).reverse()
+
+ return (
+
+ {displayTokens.map((token, i) => (
+
+
+
+ ))}
+
+ {pool.name}
+
+
+ )
+}
diff --git a/packages/lib/modules/pool/PoolList/PoolListProvider.tsx b/packages/lib/modules/pool/PoolList/PoolListProvider.tsx
index 186a20ecc..2b50e349a 100644
--- a/packages/lib/modules/pool/PoolList/PoolListProvider.tsx
+++ b/packages/lib/modules/pool/PoolList/PoolListProvider.tsx
@@ -12,21 +12,12 @@ import { usePoolListQueryState } from './usePoolListQueryState'
import { useMandatoryContext } from '@repo/lib/shared/utils/contexts'
import { useUserAccount } from '../../web3/UserAccountProvider'
import { isAddress } from 'viem'
-import { PoolListDisplayType } from '../pool.types'
export function _usePoolList({
fixedPoolTypes,
- displayType = PoolListDisplayType.TokenPills,
- hideProtocolVersion = [],
- hidePoolTypes = [],
- hidePoolTags = [],
fixedChains,
}: {
fixedPoolTypes?: GqlPoolType[]
- displayType?: PoolListDisplayType
- hideProtocolVersion?: string[]
- hidePoolTypes?: GqlPoolType[]
- hidePoolTags?: string[]
fixedChains?: GqlChain[]
} = {}) {
const queryState = usePoolListQueryState()
@@ -71,10 +62,6 @@ export function _usePoolList({
networkStatus,
isFixedPoolType,
refetch,
- displayType,
- hideProtocolVersion,
- hidePoolTypes,
- hidePoolTags,
}
}
@@ -82,26 +69,14 @@ export const PoolListContext = createContext | n
export function PoolListProvider({
fixedPoolTypes,
- displayType,
- hideProtocolVersion,
- hidePoolTypes,
- hidePoolTags,
fixedChains,
children,
}: PropsWithChildren<{
fixedPoolTypes?: GqlPoolType[]
- displayType: PoolListDisplayType
- hideProtocolVersion: string[]
- hidePoolTypes: GqlPoolType[]
- hidePoolTags: string[]
fixedChains?: GqlChain[]
}>) {
const hook = _usePoolList({
fixedPoolTypes,
- displayType,
- hideProtocolVersion,
- hidePoolTypes,
- hidePoolTags,
fixedChains,
})
diff --git a/packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx b/packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx
index 071b228b6..bce431a67 100644
--- a/packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx
+++ b/packages/lib/modules/pool/PoolList/PoolListTable/PoolListTableRow.tsx
@@ -1,6 +1,5 @@
import { Box, Grid, GridItem, GridProps, HStack, Text, Image } from '@chakra-ui/react'
import { PollListTableDetailsCell } from '@repo/lib/modules/pool/PoolList/PoolListTable/PollListTableDetailsCell'
-import { TokenIcon } from '@repo/lib/modules/tokens/TokenIcon'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { NetworkIcon } from '@repo/lib/shared/components/icons/NetworkIcon'
import MainAprTooltip from '@repo/lib/shared/components/tooltips/apr-tooltip/MainAprTooltip'
@@ -8,12 +7,11 @@ import { useCurrency } from '@repo/lib/shared/hooks/useCurrency'
import Link from 'next/link'
import { memo } from 'react'
import { usePoolMetadata } from '../../metadata/usePoolMetadata'
-import { POOL_TAG_MAP, PoolListDisplayType, PoolListItem } from '../../pool.types'
+import { POOL_TAG_MAP, PoolListItem } from '../../pool.types'
import { getPoolPath } from '../../pool.utils'
import { getUserTotalBalanceUsd } from '../../user-balance.helpers'
import { usePoolList } from '../PoolListProvider'
-import { PoolListTokenPills } from '../PoolListTokenPills'
-import { getUserReferenceTokens } from '../../pool-tokens.utils'
+import { PoolListPoolDisplay } from '../PoolListPoolDisplay'
interface Props extends GridProps {
pool: PoolListItem
@@ -23,35 +21,9 @@ interface Props extends GridProps {
const MemoizedMainAprTooltip = memo(MainAprTooltip)
-function PoolName({ pool }: { pool: PoolListItem }) {
- const isFirstToken = (index: number) => index === 0
- const displayTokens = getUserReferenceTokens(pool)
- const zIndices = Array.from({ length: displayTokens.length }, (_, index) => index).reverse()
-
- return (
-
- {displayTokens.map((token, i) => (
-
-
-
- ))}
-
- {pool.name}
-
-
- )
-}
-
export function PoolListTableRow({ pool, keyValue, needsMarginForPoints, ...rest }: Props) {
const {
queryState: { userAddress },
- displayType,
} = usePoolList()
const { name } = usePoolMetadata(pool)
const { toCurrency } = useCurrency()
@@ -76,17 +48,7 @@ export function PoolListTableRow({ pool, keyValue, needsMarginForPoints, ...rest
- {displayType === PoolListDisplayType.TokenPills && (
-
- )}
- {displayType === PoolListDisplayType.Name && }
+
@@ -120,6 +82,7 @@ export function PoolListTableRow({ pool, keyValue, needsMarginForPoints, ...rest
{
if (skip) setSkip(0)
@@ -221,7 +218,7 @@ export function usePoolListQueryState() {
orderDirection,
where: {
poolTypeIn: mappedPoolTypes,
- chainIn: networks.length > 0 ? networks : getProjectConfig().supportedNetworks,
+ chainIn: networks.length > 0 ? networks : PROJECT_CONFIG.supportedNetworks,
userAddress,
minTvl,
tagIn: mappedPoolTags.length > 0 ? mappedPoolTags : null,
diff --git a/packages/lib/modules/pool/actions/add-liquidity/modal/StakingOptions.tsx b/packages/lib/modules/pool/actions/add-liquidity/modal/StakingOptions.tsx
index 2de4719f4..4006b5c8c 100644
--- a/packages/lib/modules/pool/actions/add-liquidity/modal/StakingOptions.tsx
+++ b/packages/lib/modules/pool/actions/add-liquidity/modal/StakingOptions.tsx
@@ -12,11 +12,14 @@ import {
PartnerRedirectModal,
RedirectPartner,
} from '@repo/lib/shared/components/modals/PartnerRedirectModal'
-import { PROJECT_CONFIG, isBalancerProject } from '@repo/lib/config/getProjectConfig'
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function StakingOptions() {
const { chain, pool } = usePool()
+
+ const { projectName, projectId } = PROJECT_CONFIG
+
const canStake = !!pool.staking
const stakePath = getPoolActionPath({
id: pool.id,
@@ -32,7 +35,7 @@ export function StakingOptions() {
- {PROJECT_CONFIG.projectName}
+ {projectName}
{/* SHOULD WE USE MAX APR instead of the range?? */}
@@ -43,9 +46,9 @@ export function StakingOptions() {
@@ -61,34 +64,35 @@ export function StakingOptions() {
- {(isBalancerProject || pool.chain === GqlChain.Optimism) && pool.staking?.aura && (
-
-
- Aura
-
-
- {pool.staking?.aura ? fNum('apr', pool.staking.aura.apr) : 'Not available'}
-
-
-
-
-
- {pool.staking && pool.staking.aura && (
- <>
-
-
- >
- )}
-
-
- )}
+ {(PROJECT_CONFIG.options.showVeBal || pool.chain === GqlChain.Optimism) &&
+ pool.staking?.aura && (
+
+
+ Aura
+
+
+ {pool.staking?.aura ? fNum('apr', pool.staking.aura.apr) : 'Not available'}
+
+
+
+
+
+ {pool.staking && pool.staking.aura && (
+ <>
+
+
+ >
+ )}
+
+
+ )}
>
)
diff --git a/packages/lib/modules/pool/pool.helpers.ts b/packages/lib/modules/pool/pool.helpers.ts
index 14917f658..9d71ed46a 100644
--- a/packages/lib/modules/pool/pool.helpers.ts
+++ b/packages/lib/modules/pool/pool.helpers.ts
@@ -30,7 +30,6 @@ import { GetTokenFn } from '../tokens/TokensProvider'
import { vaultV3Abi } from '@balancer/sdk'
import { TokenCore, PoolListItem, Pool, PoolToken, PoolCore } from './pool.types'
import { ApiToken } from '../tokens/token.types'
-import { isBeetsProject, PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
import { getBlockExplorerAddressUrl } from '@repo/lib/shared/utils/blockExplorer'
/**
@@ -125,6 +124,12 @@ export function isVebalPool(poolId: string): boolean {
)
}
+export function isMaBeetsPool(poolId: string): boolean {
+ return (
+ poolId.toLowerCase() === '0x10ac2f9dae6539e77e372adb14b1bf8fbd16b3e8000200000000000000000005'
+ )
+}
+
export function isCowAmmPool(poolType: GqlPoolType): boolean {
return poolType === GqlPoolType.CowAmm
}
@@ -293,8 +298,8 @@ export function shouldBlockAddLiquidity(pool: Pool) {
// avoid blocking Sepolia pools
if (pool.chain === GqlChain.Sepolia) return false
- // don't add liquidity to the maBEETS pool thru the pool page
- if (isBeetsProject && pool.id === PROJECT_CONFIG.corePoolId) return true
+ // block add liquidity for custom scenarios eg. maBEETS
+ if (isMaBeetsPool(pool.id)) return true
const poolTokens = pool.poolTokens as GqlPoolTokenDetail[]
@@ -344,8 +349,8 @@ export function getPoolAddBlockedReason(pool: Pool): string {
if (pool.dynamicData.isPaused) return 'Paused pool'
if (pool.dynamicData.isInRecoveryMode) return 'Pool in recovery'
- // don't add liquidity to the maBEETS pool thru the pool page
- if (isBeetsProject && pool.id === PROJECT_CONFIG.corePoolId) {
+ // reason for blocking in custom scenarios eg. maBEETS
+ if (isMaBeetsPool(pool.id)) {
return 'Please manage your liquidity on the maBEETS page.'
}
diff --git a/packages/lib/modules/pool/pool.hooks.ts b/packages/lib/modules/pool/pool.hooks.ts
index c474af22b..be242d765 100644
--- a/packages/lib/modules/pool/pool.hooks.ts
+++ b/packages/lib/modules/pool/pool.hooks.ts
@@ -3,10 +3,9 @@ import { getPoolPath } from './pool.utils'
import { Pool } from './pool.types'
import { useParams } from 'next/navigation'
import { PartnerVariant } from '@repo/lib/modules/pool/pool.types'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { isCowAmmPool } from './pool.helpers'
import { useRedirect } from '@repo/lib/shared/hooks/useRedirect'
-import { Banners } from '@repo/lib/config/config.types'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function usePoolRedirect(pool: Pool) {
const path = getPoolPath(pool)
@@ -16,15 +15,10 @@ export function usePoolRedirect(pool: Pool) {
return { redirectToPoolPage }
}
-export function getVariantConfig(variant: PartnerVariant): { banners?: Banners } {
- const { variantConfig } = getProjectConfig()
- return variantConfig?.[variant] || {}
-}
-
export function usePoolVariant() {
const { variant } = useParams<{ variant: PartnerVariant }>()
- const config = getVariantConfig(variant)
+ const config = PROJECT_CONFIG.variantConfig?.[variant] || {}
return {
variant,
diff --git a/packages/lib/modules/pool/pool.types.ts b/packages/lib/modules/pool/pool.types.ts
index ab812a586..6069bdaf9 100644
--- a/packages/lib/modules/pool/pool.types.ts
+++ b/packages/lib/modules/pool/pool.types.ts
@@ -176,7 +176,7 @@ export type PoolToken = ApiToken &
nestedPool?: GqlNestedPool
}
-export enum PoolListDisplayType {
+export enum PoolDisplayType {
Name = 'name',
TokenPills = 'token-pills',
}
diff --git a/packages/lib/modules/portfolio/PortfolioProvider.tsx b/packages/lib/modules/portfolio/PortfolioProvider.tsx
index 1787715eb..249a847a7 100644
--- a/packages/lib/modules/portfolio/PortfolioProvider.tsx
+++ b/packages/lib/modules/portfolio/PortfolioProvider.tsx
@@ -1,7 +1,7 @@
'use client'
import { GetPoolsDocument } from '@repo/lib/shared/services/api/generated/graphql'
-import { useQuery as useApolloQuery } from '@apollo/experimental-nextjs-app-support/ssr'
+import { useQuery } from '@apollo/client'
import { createContext, PropsWithChildren, useCallback, useMemo } from 'react'
import { useProtocolRewards } from './PortfolioClaim/useProtocolRewards'
import { ClaimableReward, useClaimableBalances } from './PortfolioClaim/useClaimableBalances'
@@ -10,7 +10,6 @@ import { bn } from '@repo/lib/shared/utils/numbers'
import BigNumber from 'bignumber.js'
import { useMandatoryContext } from '@repo/lib/shared/utils/contexts'
import { useUserAccount } from '../web3/UserAccountProvider'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { useOnchainUserPoolBalances } from '../pool/queries/useOnchainUserPoolBalances'
import { Pool } from '../pool/pool.types'
import { useRecentTransactions } from '../transactions/RecentTransactionsProvider'
@@ -22,6 +21,7 @@ import {
getUserTotalBalanceUsd,
} from '../pool/user-balance.helpers'
import { getTimestamp } from '@repo/lib/shared/utils/time'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export interface ClaimableBalanceResult {
status: 'success' | 'error'
@@ -35,7 +35,6 @@ export type PoolRewardsData = Pool & {
}
export type PoolRewardsDataMap = Record
-
export type UsePortfolio = ReturnType
function _usePortfolio() {
@@ -43,7 +42,7 @@ function _usePortfolio() {
const { transactions } = useRecentTransactions()
const fiveMinutesAgo = getTimestamp().minsAgo(5)
- const chainIn = getProjectConfig().supportedNetworks
+ const chainIn = PROJECT_CONFIG.supportedNetworks
// filter in recent transactions that took place in the last 5 minutes
const transactionsWithPoolIds = Object.values(transactions).filter(
@@ -53,7 +52,7 @@ function _usePortfolio() {
const idIn = uniq(compact(transactionsWithPoolIds.map(tx => tx.poolId)))
// fetch pools with a user balance
- const { data: poolsUserAddressData, loading: isLoadingPoolsUserAddress } = useApolloQuery(
+ const { data: poolsUserAddressData, loading: isLoadingPoolsUserAddress } = useQuery(
GetPoolsDocument,
{
variables: {
@@ -69,7 +68,7 @@ function _usePortfolio() {
)
// fetch pools with an id in recent transactions
- const { data: poolsIdData, loading: isLoadingPoolsId } = useApolloQuery(GetPoolsDocument, {
+ const { data: poolsIdData, loading: isLoadingPoolsId } = useQuery(GetPoolsDocument, {
variables: {
where: {
idIn,
diff --git a/packages/lib/modules/portfolio/PortfolioSummary.tsx b/packages/lib/modules/portfolio/PortfolioSummary.tsx
index cd23d914a..c9f93eb29 100644
--- a/packages/lib/modules/portfolio/PortfolioSummary.tsx
+++ b/packages/lib/modules/portfolio/PortfolioSummary.tsx
@@ -6,7 +6,7 @@ import { BarChart } from 'react-feather'
import { NoisyCard } from '@repo/lib/shared/components/containers/NoisyCard'
import { ZenGarden } from '@repo/lib/shared/components/zen/ZenGarden'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
const commonNoisyCardProps: { contentProps: BoxProps; cardProps: BoxProps } = {
contentProps: {
@@ -33,6 +33,7 @@ export function PortfolioSummary() {
isLoadingClaimableRewards,
} = usePortfolio()
const { toCurrency } = useCurrency()
+
const totalBalance = portfolioData?.userTotalBalance?.toNumber()
const totalClaimableBalance = totalFiatClaimableBalance.plus(protocolRewardsBalance)
@@ -60,7 +61,7 @@ export function PortfolioSummary() {
- {`My ${getProjectConfig().projectName} liquidity`}
+ {`My ${PROJECT_CONFIG.projectName} liquidity`}
{isLoadingPortfolio ? (
diff --git a/packages/lib/modules/portfolio/PortfolioTable/PortfolioTable.tsx b/packages/lib/modules/portfolio/PortfolioTable/PortfolioTable.tsx
index ee9a895fc..baa142363 100644
--- a/packages/lib/modules/portfolio/PortfolioTable/PortfolioTable.tsx
+++ b/packages/lib/modules/portfolio/PortfolioTable/PortfolioTable.tsx
@@ -18,8 +18,8 @@ import { ExpandedPoolInfo, ExpandedPoolType, useExpandedPools } from './useExpan
import { useUserAccount } from '../../web3/UserAccountProvider'
import { ConnectWallet } from '../../web3/ConnectWallet'
import { getCanStake } from '../../pool/actions/stake.helpers'
-import { getProjectConfig, isBalancerProject } from '@repo/lib/config/getProjectConfig'
import { bn } from '@repo/lib/shared/utils/numbers'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export type PortfolioTableSortingId = 'staking' | 'vebal' | 'liquidity' | 'apr'
export interface PortfolioSortingData {
@@ -27,15 +27,15 @@ export interface PortfolioSortingData {
desc: boolean
}
-export const portfolioOrderBy: {
+export const portfolioOrderByFn: (addExtraColumn: boolean) => {
title: string
id: PortfolioTableSortingId
-}[] = [
+}[] = (addExtraColumn: boolean) => [
{
title: 'Staking',
id: 'staking',
},
- ...(isBalancerProject
+ ...(addExtraColumn
? [
{
title: 'veBAL boost',
@@ -53,14 +53,12 @@ export const portfolioOrderBy: {
},
]
-const rowProps = {
+const rowProps = (addExtraColumn: boolean) => ({
px: [0, 4],
- gridTemplateColumns: `32px minmax(320px, 1fr) 180px 110px 110px ${
- isBalancerProject ? '130px' : ''
- } 170px`,
+ gridTemplateColumns: `32px minmax(320px, 1fr) 180px 110px 110px ${addExtraColumn ? '130px' : ''} 170px`,
alignItems: 'center',
gap: { base: 'xxs', xl: 'lg' },
-}
+})
const generateStakingWeightForSort = (pool: ExpandedPoolInfo) => {
const canStake = getCanStake(pool)
@@ -84,6 +82,7 @@ export function PortfolioTable() {
const [shouldFilterTinyBalances, setShouldFilterTinyBalances] = useState(true)
const { portfolioData, isLoadingPortfolio } = usePortfolio()
const { isConnected } = useUserAccount()
+ const { projectName, options } = PROJECT_CONFIG
// Filter out pools with tiny balances (<0.01 USD)
const minUsdBalance = 0.01
@@ -159,7 +158,7 @@ export function PortfolioTable() {
- {`${getProjectConfig().projectName} portfolio`}
+ {`${projectName} portfolio`}
{isConnected ? (
)}
renderTableRow={(item: ExpandedPoolInfo, index) => {
@@ -193,7 +192,7 @@ export function PortfolioTable() {
keyValue={index}
pool={item}
veBalBoostMap={veBalBoostMap}
- {...rowProps}
+ {...rowProps(options.showVeBal)}
/>
)
}}
diff --git a/packages/lib/modules/portfolio/PortfolioTable/PortfolioTableHeader.tsx b/packages/lib/modules/portfolio/PortfolioTable/PortfolioTableHeader.tsx
index b4c54e2ea..ec18c2e95 100644
--- a/packages/lib/modules/portfolio/PortfolioTable/PortfolioTableHeader.tsx
+++ b/packages/lib/modules/portfolio/PortfolioTable/PortfolioTableHeader.tsx
@@ -1,7 +1,8 @@
import { Grid, GridItem, Icon, Text, VStack } from '@chakra-ui/react'
import { Globe } from 'react-feather'
import { SortableHeader, Sorting } from '@repo/lib/shared/components/tables/SortableHeader'
-import { portfolioOrderBy, PortfolioSortingData, PortfolioTableSortingId } from './PortfolioTable'
+import { PortfolioTableSortingId, PortfolioSortingData, portfolioOrderByFn } from './PortfolioTable'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
const setIsDesc = (id: PortfolioTableSortingId, currentSortingObj: PortfolioSortingData) =>
currentSortingObj.id === id ? !currentSortingObj.desc : true
@@ -11,6 +12,8 @@ type Props = {
setCurrentSortingObj: (value: PortfolioSortingData) => void
}
export function PortfolioTableHeader({ currentSortingObj, setCurrentSortingObj, ...rest }: Props) {
+ const portfolioOrderBy = portfolioOrderByFn(PROJECT_CONFIG.options.showVeBal)
+
return (
-
+
@@ -78,10 +75,10 @@ export function PortfolioTableRow({ pool, keyValue, veBalBoostMap, ...rest }: Pr
{stakingText}
-
+
- {isBalancerProject && (
+ {options?.showVeBal && (
@@ -102,6 +102,7 @@ export type SwapProviderProps = {
export function _useSwap({ poolActionableTokens, pool, pathParams }: SwapProviderProps) {
const urlTxHash = pathParams.urlTxHash
const isPoolSwapUrl = useIsPoolSwapUrl()
+
const isPoolSwap = pool && poolActionableTokens // Hint to tell TS that pool and poolActionableTokens must be defined when poolSwap
const shouldDiscardOldPersistedValue = isPoolSwapUrl
const swapStateVar = useMakeVarPersisted(
@@ -117,7 +118,7 @@ export function _useSwap({ poolActionableTokens, pool, pathParams }: SwapProvide
scaledAmount: BigInt(0),
},
swapType: GqlSorSwapType.ExactIn,
- selectedChain: isPoolSwap ? pool.chain : getProjectConfig().defaultNetwork,
+ selectedChain: isPoolSwap ? pool.chain : PROJECT_CONFIG.defaultNetwork,
},
'swapState',
shouldDiscardOldPersistedValue
diff --git a/packages/lib/modules/swap/swap.helpers.ts b/packages/lib/modules/swap/swap.helpers.ts
index ccef6abc0..839fbf52c 100644
--- a/packages/lib/modules/swap/swap.helpers.ts
+++ b/packages/lib/modules/swap/swap.helpers.ts
@@ -9,7 +9,7 @@ import {
import { isSameAddress } from '@repo/lib/shared/utils/addresses'
import { isMainnet } from '../chains/chain.utils'
import { SwapSimulationQueryResult } from './queries/useSimulateSwapQuery'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function swapActionPastTense(action: SwapAction): string {
switch (action) {
@@ -27,7 +27,7 @@ export function swapActionPastTense(action: SwapAction): string {
const swapErrorPatterns = [
{
pattern: /must contain at least 1 path/,
- message: `There's not enough liquidity on ${getProjectConfig().projectName} connecting these tokens to route this swap.`,
+ message: `There's not enough liquidity on ${PROJECT_CONFIG.projectName} connecting these tokens to route this swap.`,
},
{
pattern: /WrapAmountTooSmall/,
diff --git a/packages/lib/modules/vebal/lock/VebalLockDataProvider.tsx b/packages/lib/modules/vebal/lock/VebalLockDataProvider.tsx
index 786919c6a..d8793b88e 100644
--- a/packages/lib/modules/vebal/lock/VebalLockDataProvider.tsx
+++ b/packages/lib/modules/vebal/lock/VebalLockDataProvider.tsx
@@ -12,7 +12,7 @@ import { useMulticall } from '@repo/lib/modules/web3/contracts/useMulticall'
import { useCurrentDate } from '@repo/lib/shared/hooks/date.hooks'
import { toJsTimestamp } from '@repo/lib/shared/utils/time'
import { LockActionType } from '@repo/lib/modules/vebal/lock/steps/lock-steps.utils'
-import { isBalancerProject } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export type UseVebalLockDataResult = ReturnType
export const VebalLockDataContext = createContext(null)
@@ -93,7 +93,7 @@ export function _useVebalLockData() {
})
const { results, refetchAll, isLoading } = useMulticall(lockDataRequests, {
- enabled: isConnected && isBalancerProject, // Only Balancer project supports veBAL logic
+ enabled: isConnected && PROJECT_CONFIG.options.showVeBal,
})
const now = useCurrentDate()
diff --git a/packages/lib/modules/web3/AcceptPoliciesModal.tsx b/packages/lib/modules/web3/AcceptPoliciesModal.tsx
index d7ba1f937..b4893877b 100644
--- a/packages/lib/modules/web3/AcceptPoliciesModal.tsx
+++ b/packages/lib/modules/web3/AcceptPoliciesModal.tsx
@@ -21,7 +21,7 @@ import { useUserSettings } from '../user/settings/UserSettingsProvider'
import { useUserAccount } from './UserAccountProvider'
import { useDisconnect } from 'wagmi'
import NextLink from 'next/link'
-import { PROJECT_CONFIG, isBalancerProject } from '@repo/lib/config/getProjectConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function AcceptPoliciesModal() {
const { isOpen, onOpen, onClose } = useDisclosure()
@@ -29,6 +29,10 @@ export function AcceptPoliciesModal() {
const { isBlocked, isLoading, isConnected, userAddress } = useUserAccount()
const [isChecked, setIsChecked] = useState(false)
const { disconnect } = useDisconnect()
+ const {
+ projectName,
+ options: { showVeBal },
+ } = PROJECT_CONFIG
const isAddressInAcceptedPolicies = acceptedPolicies.includes(userAddress.toLowerCase())
@@ -64,7 +68,7 @@ export function AcceptPoliciesModal() {
- {`Accept ${PROJECT_CONFIG.projectName} policies`}
+ {`Accept ${projectName} policies`}
@@ -74,7 +78,7 @@ export function AcceptPoliciesModal() {
onChange={e => setIsChecked(e.target.checked)}
size="lg"
>
- {isBalancerProject ? (
+ {showVeBal ? (
By connecting my wallet, I agree to Balancer Foundation's{' '}
diff --git a/packages/lib/modules/web3/ChainConfig.tsx b/packages/lib/modules/web3/ChainConfig.tsx
index ad6ca14fb..47ee59dc8 100644
--- a/packages/lib/modules/web3/ChainConfig.tsx
+++ b/packages/lib/modules/web3/ChainConfig.tsx
@@ -16,11 +16,10 @@ import {
sepolia,
sonic,
} from 'wagmi/chains'
-
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
import { keyBy } from 'lodash'
import { getBaseUrl } from '@repo/lib/shared/utils/urls'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
/* If a request with the default rpc fails, it will fall back to the next one in the list.
https://viem.sh/docs/clients/transports/fallback#fallback-transport
@@ -76,8 +75,8 @@ const gqlChainToWagmiChainMap = {
[GqlChain.Sonic]: { iconUrl: '/images/chains/SONIC.svg', ...sonic },
} as const satisfies Record
-export const supportedNetworks = getProjectConfig().supportedNetworks
-const chainToFilter = getProjectConfig().defaultNetwork
+export const supportedNetworks = PROJECT_CONFIG.supportedNetworks
+const chainToFilter = PROJECT_CONFIG.defaultNetwork
const customChain = gqlChainToWagmiChainMap[chainToFilter]
export const chains: readonly [Chain, ...Chain[]] = [
diff --git a/packages/lib/modules/web3/WagmiConfig.tsx b/packages/lib/modules/web3/WagmiConfig.tsx
index ddbc99c9b..e047dea02 100644
--- a/packages/lib/modules/web3/WagmiConfig.tsx
+++ b/packages/lib/modules/web3/WagmiConfig.tsx
@@ -2,7 +2,6 @@
import { connectorsForWallets } from '@rainbow-me/rainbowkit'
import { Config, createConfig } from 'wagmi'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import {
coinbaseWallet,
rabbyWallet,
@@ -14,8 +13,8 @@ import {
} from '@rainbow-me/rainbowkit/wallets'
import { chains } from './ChainConfig'
import { transports } from './transports'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
-const appName = getProjectConfig().projectName
const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_ID || ''
const connectors = connectorsForWallets(
@@ -35,7 +34,7 @@ const connectors = connectorsForWallets(
},
],
{
- appName,
+ appName: PROJECT_CONFIG.projectName,
projectId,
walletConnectParameters: {
// Enforce wallet connect popup always on top
diff --git a/packages/lib/shared/components/errors/GenericError.tsx b/packages/lib/shared/components/errors/GenericError.tsx
index 335d3c41e..34c1ef4ea 100644
--- a/packages/lib/shared/components/errors/GenericError.tsx
+++ b/packages/lib/shared/components/errors/GenericError.tsx
@@ -11,9 +11,7 @@ import {
} from '../../utils/error-filters'
import { ensureError } from '../../utils/errors'
import { BalAlertLink } from '../alerts/BalAlertLink'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
-
-const balancerDiscordUrl = getProjectConfig().externalLinks.discordUrl
+import { getDiscordLink } from '../../utils/links'
type ErrorWithOptionalShortMessage = Error & { shortMessage?: string }
type Props = AlertProps & {
@@ -23,6 +21,8 @@ type Props = AlertProps & {
}
export function GenericError({ error: _error, customErrorName, skipError, ...rest }: Props) {
+ const discordUrl = getDiscordLink()
+
if (skipError) return
const error = ensureError(_error)
if (isUserRejectedError(error)) return null
@@ -33,8 +33,8 @@ export function GenericError({ error: _error, customErrorName, skipError, ...res
It looks like there was a network issue. Check your connection and try again. You can
- report the problem in our discord{' '}
- if the issue persists.
+ report the problem in our discord if the
+ issue persists.
)
@@ -45,7 +45,7 @@ export function GenericError({ error: _error, customErrorName, skipError, ...res
The pool or one of the pool tokens is paused. Check{' '}
- our discord for more information.
+ our discord for more information.
)
@@ -56,7 +56,7 @@ export function GenericError({ error: _error, customErrorName, skipError, ...res
Too many RPC requests. Please try again in some minutes. You can report the problem in{' '}
- our discord if the issue persists.
+ our discord if the issue persists.
)
@@ -68,7 +68,7 @@ export function GenericError({ error: _error, customErrorName, skipError, ...res
It looks like you don't have enough gas to complete this transaction. If you believe
this is a mistake, please report it in{' '}
- our discord.
+ our discord.
)
@@ -81,7 +81,7 @@ export function GenericError({ error: _error, customErrorName, skipError, ...res
It looks like there was an RPC Request issue. You can report the problem in{' '}
- our discord if the issue persists.
+ our discord if the issue persists.
)
diff --git a/packages/lib/shared/components/errors/UnbalancedNestedAddError.tsx b/packages/lib/shared/components/errors/UnbalancedNestedAddError.tsx
index 208722663..ca2059fa3 100644
--- a/packages/lib/shared/components/errors/UnbalancedNestedAddError.tsx
+++ b/packages/lib/shared/components/errors/UnbalancedNestedAddError.tsx
@@ -1,7 +1,7 @@
import { ErrorAlert } from './ErrorAlert'
import { AlertProps, Text } from '@chakra-ui/react'
import { BalAlertLink } from '../alerts/BalAlertLink'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { getDiscordLink } from '../../utils/links'
type Props = AlertProps & {
error: Error
@@ -28,7 +28,7 @@ export function UnbalancedNestedAddError({ error }: Props) {
Your input(s) are either too large or would excessively unbalance the pool, please try
smaller/more proportional amounts or report the issue in{' '}
- our discord.
+ our discord.
)
diff --git a/packages/lib/shared/components/marketing/EcosystemActivityChart.tsx b/packages/lib/shared/components/marketing/EcosystemActivityChart.tsx
index e350b972d..6ab1d777f 100644
--- a/packages/lib/shared/components/marketing/EcosystemActivityChart.tsx
+++ b/packages/lib/shared/components/marketing/EcosystemActivityChart.tsx
@@ -16,15 +16,14 @@ import {
import ButtonGroup from '@repo/lib/shared/components/btns/button-group/ButtonGroup'
import { PropsWithChildren } from 'react'
import { motion } from 'framer-motion'
-
import { EcosystemChainSelect } from './EcosystemChainSelect'
import { getChainShortName } from '@repo/lib/config/app.config'
-import { supportedNetworks } from '@repo/lib/modules/web3/ChainConfig'
import {
PoolActivityChartTypeTab,
gradientMap,
useEcosystemPoolActivityChart,
} from '@repo/lib/modules/marketing/useEcosystemPoolActivity'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
function AnimateOpacity({ children }: PropsWithChildren) {
return (
@@ -49,7 +48,7 @@ export function EcosystemActivityChart() {
eChartsRef,
} = useEcosystemPoolActivityChart()
- const legendTabs = supportedNetworks.map(key => {
+ const legendTabs = PROJECT_CONFIG.supportedNetworks.map(key => {
return {
label: getChainShortName(key),
color: `linear-gradient(to bottom, ${gradientMap[key].from}, ${gradientMap[key].to})`,
diff --git a/packages/lib/shared/components/marketing/EcosystemChainSelect.tsx b/packages/lib/shared/components/marketing/EcosystemChainSelect.tsx
index 03bb424c6..ed5951e61 100644
--- a/packages/lib/shared/components/marketing/EcosystemChainSelect.tsx
+++ b/packages/lib/shared/components/marketing/EcosystemChainSelect.tsx
@@ -8,10 +8,9 @@ import { ReactNode, useEffect, useState } from 'react'
import { ChevronDown } from 'react-feather'
import { motion } from 'framer-motion'
import { pulseOnceWithDelay } from '@repo/lib/shared/utils/animations'
-
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
-import { supportedNetworks } from '@repo/lib/modules/web3/ChainConfig'
import { gradientMap } from '@repo/lib/modules/marketing/useEcosystemPoolActivity'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
interface ChainOption extends OptionBase {
label: ReactNode
@@ -32,7 +31,7 @@ const networkOptions: ChainOption[] = [
),
value: 'all',
},
- ...supportedNetworks.map(network => ({
+ ...PROJECT_CONFIG.supportedNetworks.map(network => ({
label: (
void
}) {
const { openNpsModal } = useAppzi()
+ const {
+ options: { showVeBal },
+ } = PROJECT_CONFIG
return (
@@ -31,7 +35,7 @@ export function SuccessActions({
>
{returnLabel}
- {isBalancerProject && (
+ {showVeBal && (
}
onClick={openNpsModal}
@@ -43,7 +47,7 @@ export function SuccessActions({
)}
}
size="xs"
target="_blank"
diff --git a/packages/lib/shared/components/navs/CowFooter.tsx b/packages/lib/shared/components/navs/CowFooter.tsx
index ca4b44e5d..ba5ab887d 100644
--- a/packages/lib/shared/components/navs/CowFooter.tsx
+++ b/packages/lib/shared/components/navs/CowFooter.tsx
@@ -1,14 +1,14 @@
'use client'
-import { getVariantConfig } from '@repo/lib/modules/pool/pool.hooks'
import { PartnerVariant } from '@repo/lib/modules/pool/pool.types'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { Picture } from '@repo/lib/shared/components/other/Picture'
import { Box, Button, Center, Text, VStack } from '@chakra-ui/react'
import Link from 'next/link'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function CowFooter() {
- const { banners } = getVariantConfig(PartnerVariant.cow)
+ const { banners } = PROJECT_CONFIG.variantConfig?.[PartnerVariant.cow] || {}
return (
<>
diff --git a/packages/lib/shared/components/navs/Footer.tsx b/packages/lib/shared/components/navs/Footer.tsx
index 1779f5eb7..d11808585 100644
--- a/packages/lib/shared/components/navs/Footer.tsx
+++ b/packages/lib/shared/components/navs/Footer.tsx
@@ -9,6 +9,8 @@ import { ArrowUpRight } from 'react-feather'
import { AppLink } from '../navs/useNav'
import { LinkSection } from './footer.types'
import { ReactNode } from 'react'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
+import { SocialIcon } from './SocialIcon'
type CardContentProps = {
linkSections: LinkSection[]
@@ -86,7 +88,7 @@ function CardContent({ linkSections, logoType, title, subTitle }: CardContentPro
function SocialLinks({ socialLinks }: { socialLinks: AppLink[] }) {
return (
- {socialLinks.map(({ href, icon }) => (
+ {socialLinks.map(({ href, iconType }) => (
- {icon}
+
))}
@@ -132,22 +134,17 @@ function LegalLinks({ legalLinks }: { legalLinks: AppLink[] }) {
}
type FooterProps = {
- linkSections: LinkSection[]
- socialLinks: AppLink[]
- legalLinks: AppLink[]
logoType: ReactNode
title: string
subTitle: string
}
-export function Footer({
- linkSections,
- socialLinks,
- legalLinks,
- logoType,
- title,
- subTitle,
-}: FooterProps) {
+export function Footer({ logoType, title, subTitle }: FooterProps) {
+ const {
+ footer: { linkSections },
+ links: { socialLinks, legalLinks },
+ } = PROJECT_CONFIG
+
return (
diff --git a/packages/lib/shared/components/navs/MobileNav.tsx b/packages/lib/shared/components/navs/MobileNav.tsx
index e4987932f..18ba454ea 100644
--- a/packages/lib/shared/components/navs/MobileNav.tsx
+++ b/packages/lib/shared/components/navs/MobileNav.tsx
@@ -20,6 +20,7 @@ import { useRouter } from 'next/navigation'
import { useRef } from 'react'
import { ArrowUpRight, Menu } from 'react-feather'
import { AppLink, useNav } from './useNav'
+import { SocialIcon } from './SocialIcon'
type NavLinkProps = {
appLinks: AppLink[]
@@ -92,9 +93,9 @@ function EcosystemLinks({ ecosystemLinks }: EcosystemLinkProps) {
function SocialLinks({ socialLinks }: SocialLinkProps) {
return (
- {socialLinks.map(({ href, icon }) => (
+ {socialLinks.map(({ href, iconType }) => (
))}
diff --git a/packages/lib/shared/components/navs/SocialIcon.tsx b/packages/lib/shared/components/navs/SocialIcon.tsx
new file mode 100644
index 000000000..bca24f219
--- /dev/null
+++ b/packages/lib/shared/components/navs/SocialIcon.tsx
@@ -0,0 +1,30 @@
+import { XIcon } from '../icons/social/XIcon'
+import { DiscordIcon } from '../icons/social/DiscordIcon'
+import { MediumIcon } from '../icons/social/MediumIcon'
+import { GithubIcon } from '../icons/social/GithubIcon'
+import { YoutubeIcon } from '../icons/social/YoutubeIcon'
+
+export type IconType = 'x' | 'discord' | 'medium' | 'github' | 'youtube'
+
+export function SocialIcon({
+ iconType,
+ size = 24,
+}: {
+ iconType: IconType | undefined
+ size?: number
+}) {
+ switch (iconType) {
+ case 'x':
+ return
+ case 'discord':
+ return
+ case 'medium':
+ return
+ case 'github':
+ return
+ case 'youtube':
+ return
+ default:
+ return null
+ }
+}
diff --git a/packages/lib/shared/components/navs/useNav.tsx b/packages/lib/shared/components/navs/useNav.tsx
index 39f2a4e75..8e19e06a8 100644
--- a/packages/lib/shared/components/navs/useNav.tsx
+++ b/packages/lib/shared/components/navs/useNav.tsx
@@ -1,18 +1,14 @@
import { usePathname } from 'next/navigation'
-import { XIcon } from '../icons/social/XIcon'
-import { DiscordIcon } from '../icons/social/DiscordIcon'
-import { MediumIcon } from '../icons/social/MediumIcon'
-import { YoutubeIcon } from '../icons/social/YoutubeIcon'
-import { GithubIcon } from '../icons/social/GithubIcon'
import { useParams } from 'next/navigation'
import { ReactNode } from 'react'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
+import { IconType } from './SocialIcon'
export type AppLink = {
href: string
label?: string
icon?: ReactNode
isExternal?: boolean
+ iconType?: IconType
}
export function useNav() {
@@ -35,45 +31,9 @@ export function useNav() {
},
]
- const ecosystemLinks = [
- { label: 'Build', href: 'https://balancer.fi/build' },
- { label: 'Blog', href: 'https://medium.com/balancer-protocol' },
- { label: 'Docs', href: 'https://docs.balancer.fi/' },
- { label: 'Governance', href: 'https://vote.balancer.fi/#/' },
- { label: 'Analytics', href: 'https://dune.com/balancer' },
- { label: 'Forum', href: 'https://forum.balancer.fi/' },
- {
- label: 'Grants',
- href: 'https://grants.balancer.community',
- },
- ]
-
- const getSocialLinks = (size = 24) => [
- {
- icon: ,
- href: 'https://x.com/Balancer',
- },
- {
- icon: ,
- href: getProjectConfig().externalLinks.discordUrl,
- },
- {
- icon: ,
- href: 'https://medium.com/balancer-protocol',
- },
- {
- icon: ,
- href: 'https://www.youtube.com/channel/UCBRHug6Hu3nmbxwVMt8x_Ow',
- },
- {
- icon: ,
- href: 'https://github.com/balancer/',
- },
- ]
-
function linkColorFor(path: string) {
return pathname === path ? 'font.highlight' : 'font.primary'
}
- return { defaultAppLinks, ecosystemLinks, getSocialLinks, linkColorFor }
+ return { defaultAppLinks, linkColorFor }
}
diff --git a/packages/lib/shared/components/site/providers.tsx b/packages/lib/shared/components/site/providers.tsx
index c4253c732..65ac030c5 100644
--- a/packages/lib/shared/components/site/providers.tsx
+++ b/packages/lib/shared/components/site/providers.tsx
@@ -4,7 +4,6 @@ import { ReactNode } from 'react'
import { RecentTransactionsProvider } from '@repo/lib/modules/transactions/RecentTransactionsProvider'
import { ApolloGlobalDataProvider } from '@repo/lib/shared/services/api/apollo-global-data.provider'
import { UserSettingsProvider } from '@repo/lib/modules/user/settings/UserSettingsProvider'
-
import { wagmiConfig } from '@repo/lib/modules/web3/WagmiConfig'
import { GlobalAlertsProvider } from '@repo/lib/shared/components/alerts/GlobalAlertsProvider'
import { VebalLockDataProvider } from '@repo/lib/modules/vebal/lock/VebalLockDataProvider'
diff --git a/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx b/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx
index 13d307f44..9aad96a2a 100644
--- a/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx
+++ b/packages/lib/shared/components/tooltips/apr-tooltip/AddLiquidityAprTooltip.tsx
@@ -10,7 +10,13 @@ import { SparklesIcon } from './MainAprTooltip'
interface Props
extends Omit<
BaseAprTooltipProps,
- 'children' | 'totalBaseText' | 'totalBaseVeBalText' | 'maxVeBalText' | 'poolId' | 'poolType'
+ | 'children'
+ | 'totalBaseText'
+ | 'totalBaseVeBalText'
+ | 'maxVeBalText'
+ | 'poolId'
+ | 'poolType'
+ | 'chain'
> {
totalUsdValue: string
weeklyYield: string
@@ -43,6 +49,7 @@ function AddLiquidityAprTooltip({ weeklyYield, totalUsdValue, pool, ...props }:
return (
ReactNode)
+ chain: GqlChain
}
const balRewardGradient =
@@ -75,6 +80,7 @@ function BaseAprTooltip({
shouldDisplayMaxVeBalTooltip,
children,
poolType,
+ chain,
usePortal = true,
}: Props) {
const colorMode = useThemeColorMode()
@@ -117,6 +123,7 @@ function BaseAprTooltip({
aprItems,
vebalBoost: Number(vebalBoost),
numberFormatter: usedNumberFormatter,
+ chain,
})
const isVebal = isVebalPool(poolId)
diff --git a/packages/lib/shared/components/tooltips/apr-tooltip/MainAprTooltip.tsx b/packages/lib/shared/components/tooltips/apr-tooltip/MainAprTooltip.tsx
index b2ac77371..e9deaefdc 100644
--- a/packages/lib/shared/components/tooltips/apr-tooltip/MainAprTooltip.tsx
+++ b/packages/lib/shared/components/tooltips/apr-tooltip/MainAprTooltip.tsx
@@ -17,9 +17,9 @@ import { PoolListItem } from '@repo/lib/modules/pool/pool.types'
import { FeaturedPool } from '@repo/lib/modules/pool/PoolProvider'
import { Pool } from '@repo/lib/modules/pool/pool.types'
import { isLBP } from '@repo/lib/modules/pool/pool.helpers'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { GqlPoolAprItemType } from '@repo/lib/shared/services/api/generated/graphql'
import StarIcon from '../../icons/StarIcon'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
interface Props
extends Omit<
@@ -44,7 +44,6 @@ export function SparklesIcon({
pool: Pool | PoolListItem | FeaturedPool
id?: string
}) {
- const { corePoolId } = getProjectConfig()
const hoverColor = isLBP(pool.type) ? 'inherit' : 'font.highlight'
const hasRewardApr =
@@ -86,7 +85,7 @@ export function SparklesIcon({
let gradFromColor = defaultGradFrom
let gradToColor = defaultGradTo
- if (pool.id === corePoolId) {
+ if (pool.id === PROJECT_CONFIG.corePoolId) {
gradFromColor = corePoolGradFrom
gradToColor = corePoolGradTo
}
@@ -147,6 +146,7 @@ function MainAprTooltip({
return (
bn(bn(value).toFixed(4, BigNumber.ROUND_HALF_UP))
function testUseAprTooltip({ aprItems }: { aprItems: GqlPoolAprItem[] }) {
const { result } = testHook(() =>
- useAprTooltip({ aprItems, numberFormatter: defaultNumberFormatter })
+ useAprTooltip({ aprItems, numberFormatter: defaultNumberFormatter, chain: GqlChain.Mainnet })
)
return result
}
@@ -56,7 +56,7 @@ it('When the pool has BAL staking incentives (outside the veBAL system)', () =>
__typename: 'GqlPoolAprItem',
id: '0xf08d4dea369c456d26a3168ff0024b904f2d8b91-surplus',
title: 'Surplus APR',
- type: GqlPoolAprItemType.Surplus,
+ type: GqlPoolAprItemType.Surplus_24H,
apr: 0.05520228189828037,
},
// BAL incentives that are outside of the veBAL system
diff --git a/packages/lib/shared/hooks/useAprTooltip.ts b/packages/lib/shared/hooks/useAprTooltip.ts
index 790c37aef..4ea1ad46b 100644
--- a/packages/lib/shared/hooks/useAprTooltip.ts
+++ b/packages/lib/shared/hooks/useAprTooltip.ts
@@ -1,9 +1,9 @@
/* eslint-disable max-len */
-import { isBalancerProject } from '@repo/lib/config/getProjectConfig'
-import { GqlPoolAprItem, GqlPoolAprItemType } from '../services/api/generated/graphql'
+import { GqlChain, GqlPoolAprItem, GqlPoolAprItemType } from '../services/api/generated/graphql'
import { useThemeColorMode } from '../services/chakra/useThemeColorMode'
import { bn } from '../utils/numbers'
import BigNumber from 'bignumber.js'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export const swapFeesTooltipText = `LPs get swap fees anytime a swap is routed through this pool.
These fees automatically accumulate into the LP's position, so there is no need to periodically claim.`
@@ -32,8 +32,6 @@ export const votingIncentivesTooltipText = `Vote incentives are offered to veBAL
const stakingBalTooltipText = `The base APR all stakers in this pool get (determined by weekly gauge voting).
In addition, veBAL holders can get an extra boost of up to 2.5x.`
-const stakingTokenTooltipText = `3rd party incentives (outside the ${isBalancerProject ? 'veBAL' : 'gauge bounty'} system)`
-
const maBeetsVotingRewardsTooltipText =
'To receive Voting APR you must vote for incentivized pools in the bi-weekly gauge vote. APR is dependent on your vote distribution.'
@@ -75,15 +73,21 @@ export function useAprTooltip({
aprItems,
numberFormatter,
vebalBoost,
+ chain,
}: {
aprItems: GqlPoolAprItem[]
numberFormatter: (value: string) => BigNumber
vebalBoost?: number
+ chain: GqlChain
}) {
const colorMode = useThemeColorMode()
+ const {
+ options: { showVeBal },
+ } = PROJECT_CONFIG
+
const hasVeBalBoost =
- isBalancerProject && !!aprItems.find(item => item.type === GqlPoolAprItemType.StakingBoost)
+ showVeBal && !!aprItems.find(item => item.type === GqlPoolAprItemType.StakingBoost)
// Swap fees
const swapFee = aprItems.find(item => item.type === GqlPoolAprItemType.SwapFee_24H)
@@ -112,7 +116,7 @@ export function useAprTooltip({
const stakingIncentivesDisplayed = stakingIncentives.map(item => ({
title: item.rewardTokenSymbol || '',
apr: numberFormatter(item.apr.toString()),
- tooltipText: stakingTokenTooltipText,
+ tooltipText: `3rd party incentives (outside the ${showVeBal || chain === GqlChain.Optimism ? 'veBAL' : 'gauge bounty'} system)`,
}))
const votingApr = aprItems.find(item => item.type === GqlPoolAprItemType.Voting)
diff --git a/packages/lib/shared/hooks/useProtocolStats.ts b/packages/lib/shared/hooks/useProtocolStats.ts
index 4f8a9b096..0c61d0b94 100644
--- a/packages/lib/shared/hooks/useProtocolStats.ts
+++ b/packages/lib/shared/hooks/useProtocolStats.ts
@@ -1,11 +1,11 @@
import { useQuery } from '@apollo/client'
import { GetProtocolStatsDocument } from '../services/api/generated/graphql'
-import { supportedNetworks } from '@repo/lib/modules/web3/ChainConfig'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export function useProtocolStats() {
const statQuery = useQuery(GetProtocolStatsDocument, {
variables: {
- chains: supportedNetworks,
+ chains: PROJECT_CONFIG.supportedNetworks,
},
})
diff --git a/packages/lib/shared/services/api/apollo-global-data.provider.tsx b/packages/lib/shared/services/api/apollo-global-data.provider.tsx
index 8a3079bcd..824a220de 100644
--- a/packages/lib/shared/services/api/apollo-global-data.provider.tsx
+++ b/packages/lib/shared/services/api/apollo-global-data.provider.tsx
@@ -12,7 +12,6 @@ import {
GetTokenPricesDocument,
GetTokensDocument,
} from '@repo/lib/shared/services/api/generated/graphql'
-import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
import { TokensProvider } from '@repo/lib/modules/tokens/TokensProvider'
import { FiatFxRatesProvider } from '../../hooks/FxRatesProvider'
import { getFxRates } from '../../utils/currencies'
@@ -25,6 +24,7 @@ import { PoolTagsProvider } from '@repo/lib/modules/pool/tags/PoolTagsProvider'
import { getErc4626Metadata } from '@repo/lib/modules/pool/metadata/getErc4626Metadata'
import { PoolsMetadataProvider } from '@repo/lib/modules/pool/metadata/PoolsMetadataProvider'
import { getPoolsMetadata } from '@repo/lib/modules/pool/metadata/getPoolsMetadata'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
export const revalidate = 60
@@ -32,7 +32,7 @@ export async function ApolloGlobalDataProvider({ children }: PropsWithChildren)
const client = getApolloServerClient()
const tokensQueryVariables = {
- chains: getProjectConfig().supportedNetworks,
+ chains: PROJECT_CONFIG.supportedNetworks,
}
const { data: tokensQueryData } = await client.query({
@@ -48,7 +48,7 @@ export async function ApolloGlobalDataProvider({ children }: PropsWithChildren)
const { data: tokenPricesQueryData } = await client.query({
query: GetTokenPricesDocument,
variables: {
- chains: getProjectConfig().supportedNetworks,
+ chains: PROJECT_CONFIG.supportedNetworks,
},
context: {
fetchOptions: {
diff --git a/packages/lib/shared/utils/blockExplorer.ts b/packages/lib/shared/utils/blockExplorer.ts
index 502d5261d..583819a2e 100644
--- a/packages/lib/shared/utils/blockExplorer.ts
+++ b/packages/lib/shared/utils/blockExplorer.ts
@@ -1,8 +1,12 @@
import { getNetworkConfig } from '@repo/lib/config/app.config'
import { GqlChain } from '../services/api/generated/graphql'
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
-export function getBlockExplorerName(chain: GqlChain) {
- return getNetworkConfig(chain).blockExplorer.name
+const defaultChain = PROJECT_CONFIG.defaultNetwork
+
+export function getBlockExplorerName(chain?: GqlChain) {
+ const _chain = chain || defaultChain
+ return getNetworkConfig(_chain).blockExplorer.name
}
export function getBlockExplorerTxUrl(txHash: string, chain: GqlChain) {
diff --git a/packages/lib/shared/utils/links.ts b/packages/lib/shared/utils/links.ts
new file mode 100644
index 000000000..e35ab1767
--- /dev/null
+++ b/packages/lib/shared/utils/links.ts
@@ -0,0 +1,9 @@
+import { PROJECT_CONFIG } from '@repo/lib/config/getProjectConfig'
+
+export function getDiscordLink() {
+ const {
+ links: { socialLinks },
+ } = PROJECT_CONFIG
+
+ return socialLinks.find(link => link.iconType === 'discord')?.href
+}