Skip to content

Commit e94e048

Browse files
add loyalty program url if arbitrum is connected
1 parent 281b5d8 commit e94e048

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/pages/PageLayout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ const PageLayout: FC<PageLayoutProps> = ({
2323
? pages.filter((_) => !_.route.hideFromMenu).map((_) => _.route)
2424
: []
2525

26+
const visibleExternalLinks = externalLinks
27+
? externalLinks?.filter((_) => !_.hideFromMenu)
28+
: []
29+
2630
return (
2731
<>
2832
{links.length > 0 && (
29-
<SubNavigationPills links={links} externalLinks={externalLinks} />
33+
<SubNavigationPills
34+
links={links}
35+
externalLinks={visibleExternalLinks}
36+
/>
3037
)}
3138
<Container
3239
maxW={{ base: "2xl", xl: "6xl" }}

src/pages/tBTC/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ import TBTCBridge from "./Bridge"
55
import { featureFlags } from "../../constants"
66
import { ExplorerPage } from "./Explorer"
77
import { ResumeDepositPage } from "./Bridge/ResumeDeposit"
8+
import { useIsActive } from "../../hooks/useIsActive"
9+
import { SupportedChainIds } from "../../networks/enums/networks"
810

911
const MainTBTCPage: PageComponent = (props) => {
12+
const { chainId } = useIsActive()
1013
const externalLinks = [
1114
{
1215
title: "tBTC Explorer",
1316
href: "https://tbtcscan.com/",
1417
},
18+
{
19+
title: "Loyalty Program",
20+
href: "https://arbitrum.threshold.network/loyalty-program",
21+
hideFromMenu: chainId !== SupportedChainIds.Arbitrum,
22+
},
1523
]
1624

1725
return (

src/types/page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ export type PageComponent = FC<RouteProps> & {
1919

2020
export type ExternalLinkProps = LinkProps & {
2121
title: string
22+
hideFromMenu?: boolean
2223
}

0 commit comments

Comments
 (0)