|
1 | 1 | import { ChainId } from '@aave/contract-helpers'; |
2 | 2 | import { Box } from '@mui/material'; |
3 | | -import { useRouter } from 'next/router'; |
4 | 3 | import React, { ReactNode } from 'react'; |
5 | 4 | import AnalyticsConsent from 'src/components/Analytics/AnalyticsConsent'; |
6 | 5 | // import { useModalContext } from 'src/hooks/useModal'; |
7 | 6 | import { SupportModal } from 'src/layouts/SupportModal'; |
8 | | -import { useRootStore } from 'src/store/root'; |
9 | | -import { CustomMarket } from 'src/ui-config/marketsConfig'; |
10 | 7 | import { FORK_ENABLED } from 'src/utils/marketsAndNetworksConfig'; |
11 | | -import { useShallow } from 'zustand/shallow'; |
12 | 8 |
|
13 | 9 | import { AppFooter } from './AppFooter'; |
14 | 10 | import { AppHeader } from './AppHeader'; |
15 | 11 | import TopBarNotify from './TopBarNotify'; |
16 | 12 |
|
17 | | -const getCampaignConfigs = ( |
18 | | - // openSwitch: (underlyingAsset: string) => void, |
19 | | - openMarket: (market: CustomMarket) => void |
20 | | -) => ({ |
| 13 | +const getCampaignConfigs = () => ({ |
21 | 14 | [ChainId.base]: { |
22 | | - notifyText: 'A new incentives campaign is live on the Base market', |
23 | | - buttonText: 'Explore Base', |
| 15 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 16 | + buttonText: 'Join waitlist', |
24 | 17 | buttonAction: { |
25 | | - type: 'route' as const, |
26 | | - value: '/markets/?marketName=proto_base_v3', |
| 18 | + type: 'url' as const, |
| 19 | + value: 'https://aave.com/app', |
| 20 | + target: '_blank' as const, |
27 | 21 | }, |
28 | | - bannerVersion: 'base-incentives-v1', |
29 | | - icon: '/icons/networks/base.svg', |
| 22 | + bannerVersion: 'aave-app-waitlist-v1', |
30 | 23 | }, |
31 | 24 |
|
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 | | - // }, |
| 25 | + [ChainId.sonic]: { |
| 26 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 27 | + buttonText: 'Join waitlist', |
| 28 | + buttonAction: { |
| 29 | + type: 'url' as const, |
| 30 | + value: 'https://aave.com/app', |
| 31 | + target: '_blank' as const, |
| 32 | + }, |
| 33 | + bannerVersion: 'aave-app-waitlist-v1', |
| 34 | + icon: '/icons/networks/sonic.svg', |
| 35 | + }, |
42 | 36 |
|
43 | 37 | [ChainId.mainnet]: { |
44 | | - notifyText: "Horizon, Aave's RWA market, is now live.", |
45 | | - buttonText: 'Get Started', |
| 38 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 39 | + buttonText: 'Join waitlist', |
46 | 40 | buttonAction: { |
47 | | - type: 'function' as const, |
48 | | - value: () => openMarket(CustomMarket.proto_horizon_v3), |
| 41 | + type: 'url' as const, |
| 42 | + value: 'https://aave.com/app', |
| 43 | + target: '_blank' as const, |
49 | 44 | }, |
50 | | - bannerVersion: 'horizon-market-v1', |
51 | | - icon: '/icons/markets/horizon.svg', |
| 45 | + bannerVersion: 'aave-app-waitlist-v1', |
52 | 46 | }, |
53 | 47 |
|
54 | | - // [ChainId.polygon]: { |
55 | | - // notifyText: 'Swap tokens directly in the Aave App', |
56 | | - // buttonText: 'Swap Now', |
57 | | - // buttonAction: { |
58 | | - // type: 'function' as const, |
59 | | - // value: () => openSwitch('', ChainId.polygon), |
60 | | - // }, |
61 | | - // bannerVersion: 'polygon-swap-v1', |
62 | | - // icon: '/icons/networks/polygon.svg', |
63 | | - // }, |
| 48 | + [ChainId.polygon]: { |
| 49 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 50 | + buttonText: 'Join waitlist', |
| 51 | + buttonAction: { |
| 52 | + type: 'url' as const, |
| 53 | + value: 'https://aave.com/app', |
| 54 | + target: '_blank' as const, |
| 55 | + }, |
| 56 | + bannerVersion: 'aave-app-waitlist-v1', |
| 57 | + icon: '/icons/networks/polygon.svg', |
| 58 | + }, |
64 | 59 |
|
65 | | - // [ChainId.avalanche]: { |
66 | | - // notifyText: 'Swap tokens directly in the Aave App', |
67 | | - // buttonText: 'Swap Now', |
68 | | - // buttonAction: { |
69 | | - // type: 'function' as const, |
70 | | - // value: () => openSwitch('', ChainId.avalanche), |
71 | | - // }, |
72 | | - // bannerVersion: 'avalanche-swap-v1', |
73 | | - // icon: '/icons/networks/avalanche.svg', |
74 | | - // }, |
| 60 | + [ChainId.avalanche]: { |
| 61 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 62 | + buttonText: 'Join waitlist', |
| 63 | + buttonAction: { |
| 64 | + type: 'url' as const, |
| 65 | + value: 'https://aave.com/app', |
| 66 | + target: '_blank' as const, |
| 67 | + }, |
| 68 | + bannerVersion: 'aave-app-waitlist-v1', |
| 69 | + icon: '/icons/networks/avalanche.svg', |
| 70 | + }, |
75 | 71 |
|
76 | | - // [ChainId.arbitrum_one]: { |
77 | | - // notifyText: 'Swap tokens directly in the Aave App', |
78 | | - // buttonText: 'Swap Now', |
79 | | - // buttonAction: { |
80 | | - // type: 'function' as const, |
81 | | - // value: () => openSwitch('', ChainId.arbitrum_one), |
82 | | - // }, |
83 | | - // bannerVersion: 'arbitrum-swap-v1', |
84 | | - // icon: '/icons/networks/arbitrum.svg', |
85 | | - // }, |
| 72 | + [ChainId.arbitrum_one]: { |
| 73 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 74 | + buttonText: 'Join waitlist', |
| 75 | + buttonAction: { |
| 76 | + type: 'url' as const, |
| 77 | + value: 'https://aave.com/app', |
| 78 | + target: '_blank' as const, |
| 79 | + }, |
| 80 | + bannerVersion: 'aave-app-waitlist-v1', |
| 81 | + icon: '/icons/networks/arbitrum.svg', |
| 82 | + }, |
86 | 83 |
|
87 | | - // [ChainId.optimism]: { |
88 | | - // notifyText: 'Swap tokens directly in the Aave App', |
89 | | - // buttonText: 'Swap Now', |
90 | | - // buttonAction: { |
91 | | - // type: 'function' as const, |
92 | | - // value: () => openSwitch('', ChainId.optimism), |
93 | | - // }, |
94 | | - // bannerVersion: 'optimism-swap-v1', |
95 | | - // icon: '/icons/networks/optimism.svg', |
96 | | - // }, |
| 84 | + [ChainId.optimism]: { |
| 85 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 86 | + buttonText: 'Join waitlist', |
| 87 | + buttonAction: { |
| 88 | + type: 'url' as const, |
| 89 | + value: 'https://aave.com/app', |
| 90 | + target: '_blank' as const, |
| 91 | + }, |
| 92 | + bannerVersion: 'aave-app-waitlist-v1', |
| 93 | + icon: '/icons/networks/optimism.svg', |
| 94 | + }, |
97 | 95 |
|
98 | | - // [ChainId.xdai]: { |
99 | | - // notifyText: 'Swap tokens directly in the Aave App', |
100 | | - // buttonText: 'Swap Now', |
101 | | - // buttonAction: { |
102 | | - // type: 'function' as const, |
103 | | - // value: () => openSwitch('', ChainId.xdai), |
104 | | - // }, |
105 | | - // bannerVersion: 'gnosis-swap-v1', |
106 | | - // icon: '/icons/networks/gnosis.svg', |
107 | | - // }, |
| 96 | + [ChainId.xdai]: { |
| 97 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 98 | + buttonText: 'Join waitlist', |
| 99 | + buttonAction: { |
| 100 | + type: 'url' as const, |
| 101 | + value: 'https://aave.com/app', |
| 102 | + target: '_blank' as const, |
| 103 | + }, |
| 104 | + bannerVersion: 'aave-app-waitlist-v1', |
| 105 | + icon: '/icons/networks/gnosis.svg', |
| 106 | + }, |
108 | 107 |
|
109 | | - // [ChainId.bnb]: { |
110 | | - // notifyText: 'Swap tokens directly in the Aave App', |
111 | | - // buttonText: 'Swap Now', |
112 | | - // buttonAction: { |
113 | | - // type: 'function' as const, |
114 | | - // value: () => openSwitch('', ChainId.bnb), |
115 | | - // }, |
116 | | - // bannerVersion: 'binance-swap-v1', |
117 | | - // icon: '/icons/networks/binance.svg', |
118 | | - // }, |
| 108 | + [ChainId.bnb]: { |
| 109 | + notifyText: 'Introducing the Aave mobile app, a smarter way to save.', |
| 110 | + buttonText: 'Join waitlist', |
| 111 | + buttonAction: { |
| 112 | + type: 'url' as const, |
| 113 | + value: 'https://aave.com/app', |
| 114 | + target: '_blank' as const, |
| 115 | + }, |
| 116 | + bannerVersion: 'aave-app-waitlist-v1', |
| 117 | + icon: '/icons/networks/binance.svg', |
| 118 | + }, |
119 | 119 | }); |
120 | 120 |
|
121 | 121 | export function MainLayout({ children }: { children: ReactNode }) { |
122 | | - const router = useRouter(); |
123 | | - const setCurrentMarket = useRootStore(useShallow((store) => store.setCurrentMarket)); |
124 | | - |
125 | | - const openMarket = (market: CustomMarket) => { |
126 | | - setCurrentMarket(market); |
127 | | - router.push(`/markets/?marketName=${market}`); |
128 | | - }; |
129 | | - |
130 | | - const campaignConfigs = getCampaignConfigs(openMarket); |
| 122 | + const campaignConfigs = getCampaignConfigs(); |
131 | 123 |
|
132 | 124 | return ( |
133 | 125 | <> |
|
0 commit comments