Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions src/components/MarketSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,37 @@ export const MarketLogo = ({ size, logo, testChainName, sx }: MarketLogoProps) =
);
};

type MarketCategory = 'ethereum' | 'l2' | 'other';
type MarketCategory = 'ethereum' | 'l2' | 'other' | 'legacy';

const MARKET_CATEGORY: Record<string, MarketCategory> = {
// Ethereum mainnet instances
Core: 'ethereum',
Prime: 'ethereum',
EtherFi: 'ethereum',
'Aave Horizon': 'ethereum',
// L2 networks
Base: 'l2',
Arbitrum: 'l2',
OP: 'l2',
Mantle: 'l2',
Linea: 'l2',
Scroll: 'l2',
ZKsync: 'l2',
Polygon: 'l2',
Ink: 'l2',
'X Layer': 'l2',
Celo: 'l2',
Soneium: 'l2',
MegaETH: 'l2',
Metis: 'l2',
// Other L1 chains
Plasma: 'other',
Avalanche: 'other',
'BNB Chain': 'other',
Gnosis: 'other',
Sonic: 'other',
Aptos: 'other',
// Legacy markets
EtherFi: 'legacy',
ZKsync: 'legacy',
Soneium: 'legacy',
Metis: 'legacy',
Scroll: 'legacy',
};

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

const { pinned, ethereum, l2, other } = useMemo(() => {
const { pinned, ethereum, l2, other, legacy } = useMemo(() => {
const query = searchQuery.toLowerCase();
const filtered = v3Markets.filter((id) => {
const { market } = getMarketInfoById(id);
Expand All @@ -255,6 +256,7 @@ export const MarketSwitcher = () => {
ethereum: unpinned.filter((id) => getMarketCategory(id) === 'ethereum'),
l2: unpinned.filter((id) => getMarketCategory(id) === 'l2'),
other: unpinned.filter((id) => getMarketCategory(id) === 'other'),
legacy: unpinned.filter((id) => getMarketCategory(id) === 'legacy'),
};
}, [v3Markets, searchQuery, favoriteMarkets, isFavoriteMarket]);

Expand Down Expand Up @@ -540,6 +542,17 @@ export const MarketSwitcher = () => {
<Box sx={{ display: 'flex', flexWrap: 'wrap', px: 1.5 }}>
{l2.map((id) => renderGridItem(id, mobile))}
</Box>
<Divider sx={{ my: 1 }} />
</Box>
)}

{/* Legacy */}
{legacy.length > 0 && (
<Box>
{sectionHeader(<Trans>Legacy</Trans>)}
<Box sx={{ display: 'flex', flexWrap: 'wrap', px: 1.5 }}>
{legacy.map((id) => renderGridItem(id, mobile))}
</Box>
</Box>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/locales/el/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,10 @@ msgstr "Protocol borrow cap is at 100% for this asset. Further borrowing unavail
msgid "Disabling E-Mode"
msgstr "Disabling E-Mode"

#: src/components/MarketSwitcher.tsx
msgid "Legacy"
msgstr "Legacy"

#: src/modules/history/HistoryWrapper.tsx
msgid "This list may not include all your swaps."
msgstr "This list may not include all your swaps."
Expand Down
2 changes: 1 addition & 1 deletion src/locales/es/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/fr/messages.js

Large diffs are not rendered by default.

Loading