Skip to content

Commit 826c8f5

Browse files
authored
chore: add frozen markets to legacy section (#2964)
1 parent 27c015a commit 826c8f5

6 files changed

Lines changed: 28 additions & 11 deletions

File tree

‎src/components/MarketSwitcher.tsx‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,36 +111,37 @@ export const MarketLogo = ({ size, logo, testChainName, sx }: MarketLogoProps) =
111111
);
112112
};
113113

114-
type MarketCategory = 'ethereum' | 'l2' | 'other';
114+
type MarketCategory = 'ethereum' | 'l2' | 'other' | 'legacy';
115115

116116
const MARKET_CATEGORY: Record<string, MarketCategory> = {
117117
// Ethereum mainnet instances
118118
Core: 'ethereum',
119119
Prime: 'ethereum',
120-
EtherFi: 'ethereum',
121120
'Aave Horizon': 'ethereum',
122121
// L2 networks
123122
Base: 'l2',
124123
Arbitrum: 'l2',
125124
OP: 'l2',
126125
Mantle: 'l2',
127126
Linea: 'l2',
128-
Scroll: 'l2',
129-
ZKsync: 'l2',
130127
Polygon: 'l2',
131128
Ink: 'l2',
132129
'X Layer': 'l2',
133130
Celo: 'l2',
134-
Soneium: 'l2',
135131
MegaETH: 'l2',
136-
Metis: 'l2',
137132
// Other L1 chains
138133
Plasma: 'other',
139134
Avalanche: 'other',
140135
'BNB Chain': 'other',
141136
Gnosis: 'other',
142137
Sonic: 'other',
143138
Aptos: 'other',
139+
// Legacy markets
140+
EtherFi: 'legacy',
141+
ZKsync: 'legacy',
142+
Soneium: 'legacy',
143+
Metis: 'legacy',
144+
Scroll: 'legacy',
144145
};
145146

146147
const getMarketCategory = (marketId: CustomMarket): MarketCategory => {
@@ -238,7 +239,7 @@ export const MarketSwitcher = () => {
238239
// Filter to V3 markets only
239240
const v3Markets = useMemo(() => availableMarkets.filter((id) => marketsData[id].v3), []);
240241

241-
const { pinned, ethereum, l2, other } = useMemo(() => {
242+
const { pinned, ethereum, l2, other, legacy } = useMemo(() => {
242243
const query = searchQuery.toLowerCase();
243244
const filtered = v3Markets.filter((id) => {
244245
const { market } = getMarketInfoById(id);
@@ -255,6 +256,7 @@ export const MarketSwitcher = () => {
255256
ethereum: unpinned.filter((id) => getMarketCategory(id) === 'ethereum'),
256257
l2: unpinned.filter((id) => getMarketCategory(id) === 'l2'),
257258
other: unpinned.filter((id) => getMarketCategory(id) === 'other'),
259+
legacy: unpinned.filter((id) => getMarketCategory(id) === 'legacy'),
258260
};
259261
}, [v3Markets, searchQuery, favoriteMarkets, isFavoriteMarket]);
260262

@@ -540,6 +542,17 @@ export const MarketSwitcher = () => {
540542
<Box sx={{ display: 'flex', flexWrap: 'wrap', px: 1.5 }}>
541543
{l2.map((id) => renderGridItem(id, mobile))}
542544
</Box>
545+
<Divider sx={{ my: 1 }} />
546+
</Box>
547+
)}
548+
549+
{/* Legacy */}
550+
{legacy.length > 0 && (
551+
<Box>
552+
{sectionHeader(<Trans>Legacy</Trans>)}
553+
<Box sx={{ display: 'flex', flexWrap: 'wrap', px: 1.5 }}>
554+
{legacy.map((id) => renderGridItem(id, mobile))}
555+
</Box>
543556
</Box>
544557
)}
545558

‎src/locales/el/messages.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/locales/en/messages.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/locales/en/messages.po‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,10 @@ msgstr "Protocol borrow cap is at 100% for this asset. Further borrowing unavail
19711971
msgid "Disabling E-Mode"
19721972
msgstr "Disabling E-Mode"
19731973

1974+
#: src/components/MarketSwitcher.tsx
1975+
msgid "Legacy"
1976+
msgstr "Legacy"
1977+
19741978
#: src/modules/history/HistoryWrapper.tsx
19751979
msgid "This list may not include all your swaps."
19761980
msgstr "This list may not include all your swaps."

‎src/locales/es/messages.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/locales/fr/messages.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)