Skip to content

Commit

Permalink
add loyalty program url if arbitrum is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrosaturnino committed Feb 10, 2025
1 parent a34f77e commit 46e51d7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@ const PageLayout: FC<PageLayoutProps> = ({
? pages.filter((_) => !_.route.hideFromMenu).map((_) => _.route)
: []

const visibleExternalLinks = externalLinks
? externalLinks?.filter((_) => !_.hideFromMenu)
: []

return (
<>
{links.length > 0 && (
<SubNavigationPills links={links} externalLinks={externalLinks} />
<SubNavigationPills
links={links}
externalLinks={visibleExternalLinks}
/>
)}
<Container
maxW={{ base: "2xl", xl: "6xl" }}
Expand Down
8 changes: 8 additions & 0 deletions src/pages/tBTC/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ import TBTCBridge from "./Bridge"
import { featureFlags } from "../../constants"
import { ExplorerPage } from "./Explorer"
import { ResumeDepositPage } from "./Bridge/ResumeDeposit"
import { useIsActive } from "../../hooks/useIsActive"
import { SupportedChainIds } from "../../networks/enums/networks"

const MainTBTCPage: PageComponent = (props) => {
const { chainId } = useIsActive()
const externalLinks = [
{
title: "tBTC Explorer",
href: "https://tbtcscan.com/",
},
{
title: "Loyalty Program",
href: "https://arbitrum.threshold.network/loyalty-program",
hideFromMenu: chainId !== SupportedChainIds.Arbitrum,
},
]

return (
Expand Down
1 change: 1 addition & 0 deletions src/types/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export type PageComponent = FC<RouteProps> & {

export type ExternalLinkProps = LinkProps & {
title: string
hideFromMenu?: boolean
}

0 comments on commit 46e51d7

Please sign in to comment.