From 34e2a22611fbbf65789e5a80ef344f434923dd60 Mon Sep 17 00:00:00 2001 From: Sam Mason de Caires Date: Tue, 16 Jun 2026 14:22:15 +0100 Subject: [PATCH] chore: remove market switcher functionality for umbrella --- src/locales/en/messages.po | 1 - .../umbrella/UmbrellaMarketSwitcher.tsx | 311 ++---------------- 2 files changed, 22 insertions(+), 290 deletions(-) diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 74cda60b88..c59740a24f 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -1333,7 +1333,6 @@ msgstr "You have assets with zero LTV that are blocking this operation. Please w #: src/modules/staking/SavingsGhoProgram.tsx #: src/modules/umbrella/StakeCooldownModalContent.tsx #: src/modules/umbrella/StakeCooldownModalContent.tsx -#: src/modules/umbrella/UmbrellaMarketSwitcher.tsx msgid "{0}" msgstr "{0}" diff --git a/src/modules/umbrella/UmbrellaMarketSwitcher.tsx b/src/modules/umbrella/UmbrellaMarketSwitcher.tsx index 78d352f5aa..75c066c8cf 100644 --- a/src/modules/umbrella/UmbrellaMarketSwitcher.tsx +++ b/src/modules/umbrella/UmbrellaMarketSwitcher.tsx @@ -1,29 +1,12 @@ -import { ChevronDownIcon } from '@heroicons/react/outline'; -import { Trans } from '@lingui/macro'; -import { - Box, - BoxProps, - ListItemText, - MenuItem, - SvgIcon, - TextField, - Tooltip, - Typography, - useMediaQuery, - useTheme, -} from '@mui/material'; -import React, { useState } from 'react'; +import { Box, BoxProps, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material'; +import React from 'react'; import { useRootStore } from 'src/store/root'; import { BaseNetworkConfig } from 'src/ui-config/networksConfig'; -import { DASHBOARD } from 'src/utils/events'; import { - availableMarkets, CustomMarket, - ENABLE_TESTNET, MarketDataType, marketsData, networkConfigs, - STAGING_ENV, } from 'src/utils/marketsAndNetworksConfig'; import { useShallow } from 'zustand/shallow'; @@ -102,284 +85,34 @@ export const MarketLogo = ({ size, logo, testChainName, sx }: MarketLogoProps) = ); }; -enum SelectedMarketVersion { - V2, - V3, -} - -// TODO -// Fetch markets that are active for umbrella. -// Strip out any code not used for v2 -// Style to design specifications - export const MarketSwitcher = () => { - const [selectedMarketVersion] = useState(SelectedMarketVersion.V3); const theme = useTheme(); const upToLG = useMediaQuery(theme.breakpoints.up('lg')); const downToXSM = useMediaQuery(theme.breakpoints.down('xsm')); - const [trackEvent, currentMarket, setCurrentMarket] = useRootStore( - useShallow((store) => [store.trackEvent, store.currentMarket, store.setCurrentMarket]) - ); - - const isV3MarketsAvailable = availableMarkets - .map((marketId: CustomMarket) => { - const { market } = getMarketInfoById(marketId); + const currentMarket = useRootStore(useShallow((store) => store.currentMarket)); - return market.v3; - }) - .some((item) => !!item); - - const handleMarketSelect = (e: React.ChangeEvent) => { - trackEvent(DASHBOARD.CHANGE_MARKET, { market: e.target.value }); - setCurrentMarket(e.target.value as unknown as CustomMarket); - }; - - // const marketBlurbs: { [key: string]: JSX.Element } = { - // proto_mainnet_v3: ( - // Main Ethereum market with the largest selection of assets and yield options - // ), - // proto_lido_v3: ( - // Optimized for efficiency and risk by supporting blue-chip collateral assets - // ), - // }; + const { market, logo } = getMarketInfoById(currentMarket); return ( - null, - renderValue: (marketId) => { - const { market, logo } = getMarketInfoById(marketId as CustomMarket); - - return ( - - {/* Main Row with Market Name */} - - - - - {getMarketHelpData(market.marketTitle).name} {market.isFork ? 'Fork' : ''} - {/* {upToLG && - (currentMarket === 'proto_mainnet_v3' || currentMarket === 'proto_lido_v3') - ? 'Instance' - : ' Market'} */} - - - - {/* - V2 - */} - - - - - - - - {/* {marketBlurbs[currentMarket] && ( - - {marketBlurbs[currentMarket]} - - )} */} - - ); - }, - - sx: { - '&.MarketSwitcher__select .MuiSelect-outlined': { - pl: 0, - py: 0, - backgroundColor: 'transparent !important', - }, - '.MuiSelect-icon': { color: '#F1F1F3' }, - }, - MenuProps: { - anchorOrigin: { - vertical: 'bottom', - horizontal: 'right', - }, - transformOrigin: { - vertical: 'top', - horizontal: 'right', - }, - PaperProps: { - style: { - minWidth: 240, - }, - variant: 'outlined', - elevation: 0, - }, - }, - }} - > - - - - {ENABLE_TESTNET || STAGING_ENV ? 'Select Aave Testnet Market' : 'Select Aave Market'} - + + {/* Main Row with Market Name */} + + + + {getMarketHelpData(market.marketTitle).name} {market.isFork ? 'Fork' : ''} - {isV3MarketsAvailable && ( - - {/* { - if (value !== null) { - setSelectedMarketVersion(value); - } - }} - sx={{ - width: '100%', - height: '36px', - background: theme.palette.primary.main, - border: `1px solid ${ - theme.palette.mode === 'dark' ? 'rgba(235, 235, 237, 0.12)' : '#1B2030' - }`, - borderRadius: '6px', - marginTop: '16px', - marginBottom: '12px', - padding: '2px', - }} - > - - theme.palette.gradients.aaveGradient, - backgroundClip: 'text', - color: 'transparent', - } - : { - color: theme.palette.mode === 'dark' ? '#0F121D' : '#FFFFFF', - } - } - > - Version 3 - - - - theme.palette.gradients.aaveGradient, - backgroundClip: 'text', - color: 'transparent', - } - : { - color: theme.palette.mode === 'dark' ? '#0F121D' : '#FFFFFF', - } - } - > - Version 2 - - - */} - - )} - {availableMarkets.map((marketId: CustomMarket) => { - const { market, logo } = getMarketInfoById(marketId); - const marketNaming = getMarketHelpData(market.marketTitle); - return ( - - - - {marketNaming.name} {market.isFork ? 'Fork' : ''} - - - - {marketNaming.testChainName} - - - - ); - })} - + ); };