Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update market names #2280

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
129 changes: 88 additions & 41 deletions src/components/MarketSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ export const MarketSwitcher = () => {
setCurrentMarket(e.target.value as unknown as CustomMarket);
};

const marketBlurbs: { [key: string]: string } = {
proto_mainnet_v3: 'The most liquid and risk-adjusted market with diverse yield options.',
proto_lido_v3: 'Focused on blue-chip collaterals and high leverage use cases.',
};

return (
<TextField
select
Expand All @@ -149,60 +154,98 @@ export const MarketSwitcher = () => {
SelectProps={{
native: false,
className: 'MarketSwitcher__select',
IconComponent: (props) => (
<SvgIcon fontSize="medium" {...props}>
<ChevronDownIcon />
</SvgIcon>
),
IconComponent: () => null,
renderValue: (marketId) => {
const { market, logo } = getMarketInfoById(marketId as CustomMarket);

return (
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<MarketLogo
size={upToLG ? 32 : 28}
logo={logo}
testChainName={getMarketHelpData(market.marketTitle).testChainName}
/>
<Box sx={{ mr: 1, display: 'inline-flex', alignItems: 'flex-start' }}>
<Box>
{/* Main Row with Market Name */}
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<MarketLogo
size={upToLG ? 32 : 28}
logo={logo}
testChainName={getMarketHelpData(market.marketTitle).testChainName}
/>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<Typography
variant={upToLG ? 'display1' : 'h1'}
sx={{
fontSize: downToXSM ? '1.55rem' : undefined,
color: 'common.white',
mr: 1,
}}
>
{getMarketHelpData(market.marketTitle).name} {market.isFork ? 'Fork' : ''}
{upToLG && ' Market'}
</Typography>
{market.v3 ? (
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Box
sx={{
color: '#fff',
px: 2,
borderRadius: '12px',
background: (theme) => theme.palette.gradients.aaveGradient,
display: 'flex',
alignItems: 'center',
}}
>
<Typography variant="subheader2">V3</Typography>
</Box>
<SvgIcon
fontSize="medium"
sx={{
ml: 1,
color: '#F1F1F3',
}}
>
<ChevronDownIcon />
</SvgIcon>
</Box>
) : (
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Box
sx={{
color: '#A5A8B6',
px: 2,
borderRadius: '12px',
backgroundColor: '#383D51',
display: 'flex',
alignItems: 'center',
}}
>
<Typography variant="subheader2">V2</Typography>
</Box>
<SvgIcon
fontSize="medium"
sx={{
ml: 1,
color: '#F1F1F3',
}}
>
<ChevronDownIcon />
</SvgIcon>
</Box>
)}
</Box>
</Box>

{marketBlurbs[currentMarket] && (
<Typography
variant={upToLG ? 'display1' : 'h1'}
sx={{
fontSize: downToXSM ? '1.55rem' : undefined,
color: 'common.white',
mr: 1,
mt: 0.5,
fontSize: '0.85rem',
}}
>
{getMarketHelpData(market.marketTitle).name} {market.isFork ? 'Fork' : ''}
{upToLG && ' Market'}
{marketBlurbs[currentMarket]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll have to wrap the blurb, it overflows on mobile screens

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, added in fb3662b

</Typography>
{market.v3 ? (
<Box
sx={{
color: '#fff',
px: 2,
borderRadius: '12px',
background: (theme) => theme.palette.gradients.aaveGradient,
}}
>
<Typography variant="subheader2">V3</Typography>
</Box>
) : (
<Box
sx={{
color: '#A5A8B6',
px: 2,
borderRadius: '12px',
backgroundColor: '#383D51',
}}
>
<Typography variant="subheader2">V2</Typography>
</Box>
)}
</Box>
)}
</Box>
);
},

sx: {
'&.MarketSwitcher__select .MuiSelect-outlined': {
pl: 0,
Expand All @@ -216,6 +259,10 @@ export const MarketSwitcher = () => {
vertical: 'bottom',
horizontal: 'right',
},
transformOrigin: {
vertical: 'top',
horizontal: 'right',
},
PaperProps: {
style: {
minWidth: 240,
Expand Down
4 changes: 2 additions & 2 deletions src/ui-config/marketsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const marketsData: {
[key in keyof typeof CustomMarket]: MarketDataType;
} = {
[CustomMarket.proto_mainnet_v3]: {
marketTitle: 'Ethereum',
marketTitle: 'Core',
market: CustomMarket.proto_mainnet_v3,
chainId: ChainId.mainnet,
v3: true,
Expand Down Expand Up @@ -139,7 +139,7 @@ export const marketsData: {
},
},
[CustomMarket.proto_lido_v3]: {
marketTitle: 'Lido',
marketTitle: 'Prime',
market: CustomMarket.proto_lido_v3,
chainId: ChainId.mainnet,
v3: true,
Expand Down
Loading