Skip to content

Commit 7255f05

Browse files
sammdecclaude
andauthored
feat: replace V4 announcement banner with permanent header button (aave#3089)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ac72559 commit 7255f05

3 files changed

Lines changed: 22 additions & 121 deletions

File tree

src/components/MarketSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const getMarketOrder = (marketId: CustomMarket): number => {
183183
return MARKET_ORDER_BY_TITLE[market.marketTitle] ?? 999;
184184
};
185185

186-
const AAVE_PRO_URL = 'https://pro.aave.com/';
186+
export const AAVE_PRO_URL = 'https://pro.aave.com/';
187187

188188
type V4Link = {
189189
id: string;

src/layouts/AppHeader.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import * as React from 'react';
2222
import { useEffect, useState } from 'react';
2323
import { AvatarSize } from 'src/components/Avatar';
2424
import { ContentWithTooltip } from 'src/components/ContentWithTooltip';
25+
import { AAVE_PRO_URL } from 'src/components/MarketSwitcher';
2526
import { UserDisplay } from 'src/components/UserDisplay';
2627
import { ConnectWalletButton } from 'src/components/WalletConnection/ConnectWalletButton';
2728
import { useModalContext } from 'src/hooks/useModal';
@@ -276,6 +277,25 @@ export function AppHeader() {
276277

277278
<Box sx={{ flexGrow: 1 }} />
278279

280+
<NoSsr>
281+
<Button
282+
component={Link}
283+
href={AAVE_PRO_URL}
284+
variant="surface"
285+
sx={{
286+
p: '7px 8px',
287+
minWidth: 'unset',
288+
alignItems: 'center',
289+
mr: 2,
290+
whiteSpace: 'nowrap',
291+
}}
292+
>
293+
<Typography component="span" typography="subheader1">
294+
{smd ? 'V4' : 'Aave V4'}
295+
</Typography>
296+
</Button>
297+
</NoSsr>
298+
279299
<NoSsr>
280300
<StyledBadge
281301
invisible={true}

src/layouts/MainLayout.tsx

Lines changed: 1 addition & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChainId } from '@aave/contract-helpers';
21
import { Box } from '@mui/material';
32
import React, { ReactNode } from 'react';
43
import AnalyticsConsent from 'src/components/Analytics/AnalyticsConsent';
@@ -10,125 +9,7 @@ import { AppFooter } from './AppFooter';
109
import { AppHeader } from './AppHeader';
1110
import TopBarNotify from './TopBarNotify';
1211

13-
const getCampaignConfigs = () => ({
14-
[ChainId.base]: {
15-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
16-
buttonText: 'Try it out here',
17-
buttonAction: {
18-
type: 'url' as const,
19-
value: 'https://pro.aave.com/',
20-
target: '_blank' as const,
21-
},
22-
bannerVersion: 'aave-pro-mainnet-v1',
23-
},
24-
25-
[ChainId.sonic]: {
26-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
27-
buttonText: 'Try it out here',
28-
buttonAction: {
29-
type: 'url' as const,
30-
value: 'https://pro.aave.com/',
31-
target: '_blank' as const,
32-
},
33-
bannerVersion: 'aave-pro-mainnet-v1',
34-
// icon: '/icons/networks/sonic.svg',
35-
},
36-
37-
[ChainId.mainnet]: {
38-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
39-
buttonText: 'Try it out here',
40-
buttonAction: {
41-
type: 'url' as const,
42-
value: 'https://pro.aave.com/',
43-
target: '_blank' as const,
44-
},
45-
bannerVersion: 'aave-pro-mainnet-v1',
46-
},
47-
48-
[ChainId.polygon]: {
49-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
50-
buttonText: 'Try it out here',
51-
buttonAction: {
52-
type: 'url' as const,
53-
value: 'https://pro.aave.com/',
54-
target: '_blank' as const,
55-
},
56-
bannerVersion: 'aave-pro-mainnet-v1',
57-
// icon: '/icons/networks/polygon.svg',
58-
},
59-
60-
[ChainId.avalanche]: {
61-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
62-
buttonText: 'Try it out here',
63-
buttonAction: {
64-
type: 'url' as const,
65-
value: 'https://pro.aave.com/',
66-
target: '_blank' as const,
67-
},
68-
bannerVersion: 'aave-pro-mainnet-v1',
69-
// icon: '/icons/networks/avalanche.svg',
70-
},
71-
72-
[ChainId.arbitrum_one]: {
73-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
74-
buttonText: 'Try it out here',
75-
buttonAction: {
76-
type: 'url' as const,
77-
value: 'https://pro.aave.com/',
78-
target: '_blank' as const,
79-
},
80-
bannerVersion: 'aave-pro-mainnet-v1',
81-
// icon: '/icons/networks/arbitrum.svg',
82-
},
83-
84-
[ChainId.optimism]: {
85-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
86-
buttonText: 'Try it out here',
87-
buttonAction: {
88-
type: 'url' as const,
89-
value: 'https://pro.aave.com/',
90-
target: '_blank' as const,
91-
},
92-
bannerVersion: 'aave-pro-mainnet-v1',
93-
// icon: '/icons/networks/optimism.svg',
94-
},
95-
96-
[ChainId.xdai]: {
97-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
98-
buttonText: 'Try it out here',
99-
buttonAction: {
100-
type: 'url' as const,
101-
value: 'https://pro.aave.com/',
102-
target: '_blank' as const,
103-
},
104-
bannerVersion: 'aave-pro-mainnet-v1',
105-
// icon: '/icons/networks/gnosis.svg',
106-
},
107-
108-
[ChainId.bnb]: {
109-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
110-
buttonText: 'Try it out here',
111-
buttonAction: {
112-
type: 'url' as const,
113-
value: 'https://pro.aave.com/',
114-
target: '_blank' as const,
115-
},
116-
bannerVersion: 'aave-pro-mainnet-v1',
117-
// icon: '/icons/networks/binance.svg',
118-
},
119-
120-
[ChainId.ink]: {
121-
notifyText: 'Aave V4 is now live on Ethereum mainnet.',
122-
buttonText: 'Try it out here',
123-
buttonAction: {
124-
type: 'url' as const,
125-
value: 'https://pro.aave.com/',
126-
target: '_blank' as const,
127-
},
128-
bannerVersion: 'aave-pro-mainnet-v1',
129-
// icon: '/icons/networks/ink.svg',
130-
},
131-
});
12+
const getCampaignConfigs = () => ({});
13213

13314
// For defining Route specific campaigns if needed in future
13415
const routeCampaigns = {

0 commit comments

Comments
 (0)