Skip to content

Commit 3c11748

Browse files
authored
chore: banner (#2551)
1 parent 0aafa7a commit 3c11748

1 file changed

Lines changed: 99 additions & 7 deletions

File tree

src/layouts/MainLayout.tsx

Lines changed: 99 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
import { ChainId } from '@aave/contract-helpers';
22
import { Box } from '@mui/material';
3+
// import { useRouter } from 'next/router';
34
import React, { ReactNode } from 'react';
45
import AnalyticsConsent from 'src/components/Analytics/AnalyticsConsent';
56
import { useModalContext } from 'src/hooks/useModal';
67
import { FeedbackModal } from 'src/layouts/FeedbackDialog';
8+
// import { useRootStore } from 'src/store/root';
9+
import { CustomMarket } from 'src/ui-config/marketsConfig';
710
import { FORK_ENABLED } from 'src/utils/marketsAndNetworksConfig';
811

12+
// import { useShallow } from 'zustand/shallow';
913
import { AppFooter } from './AppFooter';
1014
import { AppHeader } from './AppHeader';
1115
import TopBarNotify from './TopBarNotify';
1216

13-
const getCampaignConfigs = (openSwitch: (token?: string, chainId?: number) => void) => ({
17+
const getCampaignConfigs = (
18+
openSwitch: (token?: string, chainId?: number) => void
19+
// openMarket: (market: CustomMarket) => void
20+
) => ({
1421
[ChainId.base]: {
1522
notifyText: 'A new incentives campaign is live on the Base market',
1623
buttonText: 'Explore Base',
@@ -22,20 +29,105 @@ const getCampaignConfigs = (openSwitch: (token?: string, chainId?: number) => vo
2229
icon: '/icons/networks/base.svg',
2330
},
2431

25-
[ChainId.sonic]: {
26-
notifyText: 'Swaps are now live on Sonic',
27-
buttonText: 'Swap Now',
32+
// [ChainId.sonic]: {
33+
// notifyText: 'Swaps are now live on Sonic',
34+
// buttonText: 'Swap Now',
35+
// buttonAction: {
36+
// type: 'function' as const,
37+
// value: () => openSwitch('', ChainId.sonic),
38+
// },
39+
// bannerVersion: 'sonic-incentives-v1',
40+
// icon: '/icons/networks/sonic.svg',
41+
// },
42+
43+
[ChainId.mainnet]: {
44+
notifyText:
45+
'If you hold Pendle PT tokens at maturity, you can now swap your collateral to a new maturity',
46+
buttonText: 'Get Started',
2847
buttonAction: {
2948
type: 'function' as const,
30-
value: () => openSwitch('', ChainId.sonic),
49+
value: () => openSwitch(CustomMarket.proto_mainnet_v3),
3150
},
32-
bannerVersion: 'sonic-incentives-v1',
33-
icon: '/icons/networks/sonic.svg',
51+
bannerVersion: 'ethereum-swap-v1',
52+
// icon: '/icons/networks/ethereum.svg',
3453
},
54+
55+
// [ChainId.polygon]: {
56+
// notifyText: 'Swap tokens directly in the Aave App',
57+
// buttonText: 'Swap Now',
58+
// buttonAction: {
59+
// type: 'function' as const,
60+
// value: () => openSwitch('', ChainId.polygon),
61+
// },
62+
// bannerVersion: 'polygon-swap-v1',
63+
// icon: '/icons/networks/polygon.svg',
64+
// },
65+
66+
// [ChainId.avalanche]: {
67+
// notifyText: 'Swap tokens directly in the Aave App',
68+
// buttonText: 'Swap Now',
69+
// buttonAction: {
70+
// type: 'function' as const,
71+
// value: () => openSwitch('', ChainId.avalanche),
72+
// },
73+
// bannerVersion: 'avalanche-swap-v1',
74+
// icon: '/icons/networks/avalanche.svg',
75+
// },
76+
77+
// [ChainId.arbitrum_one]: {
78+
// notifyText: 'Swap tokens directly in the Aave App',
79+
// buttonText: 'Swap Now',
80+
// buttonAction: {
81+
// type: 'function' as const,
82+
// value: () => openSwitch('', ChainId.arbitrum_one),
83+
// },
84+
// bannerVersion: 'arbitrum-swap-v1',
85+
// icon: '/icons/networks/arbitrum.svg',
86+
// },
87+
88+
// [ChainId.optimism]: {
89+
// notifyText: 'Swap tokens directly in the Aave App',
90+
// buttonText: 'Swap Now',
91+
// buttonAction: {
92+
// type: 'function' as const,
93+
// value: () => openSwitch('', ChainId.optimism),
94+
// },
95+
// bannerVersion: 'optimism-swap-v1',
96+
// icon: '/icons/networks/optimism.svg',
97+
// },
98+
99+
// [ChainId.xdai]: {
100+
// notifyText: 'Swap tokens directly in the Aave App',
101+
// buttonText: 'Swap Now',
102+
// buttonAction: {
103+
// type: 'function' as const,
104+
// value: () => openSwitch('', ChainId.xdai),
105+
// },
106+
// bannerVersion: 'gnosis-swap-v1',
107+
// icon: '/icons/networks/gnosis.svg',
108+
// },
109+
110+
// [ChainId.bnb]: {
111+
// notifyText: 'Swap tokens directly in the Aave App',
112+
// buttonText: 'Swap Now',
113+
// buttonAction: {
114+
// type: 'function' as const,
115+
// value: () => openSwitch('', ChainId.bnb),
116+
// },
117+
// bannerVersion: 'binance-swap-v1',
118+
// icon: '/icons/networks/binance.svg',
119+
// },
35120
});
36121

37122
export function MainLayout({ children }: { children: ReactNode }) {
38123
const { openSwitch } = useModalContext();
124+
// const router = useRouter();
125+
// const setCurrentMarket = useRootStore(useShallow((store) => store.setCurrentMarket));
126+
127+
// const openMarket = (market: CustomMarket) => {
128+
// setCurrentMarket(market);
129+
// router.push(`/markets/?marketName=${market}`);
130+
// };
39131

40132
const campaignConfigs = getCampaignConfigs(openSwitch);
41133

0 commit comments

Comments
 (0)