Skip to content

Commit

Permalink
chore: update market names (#2280)
Browse files Browse the repository at this point in the history
  • Loading branch information
foodaka authored Dec 18, 2024
1 parent f73b2cd commit 695a536
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 45 deletions.
140 changes: 99 additions & 41 deletions src/components/MarketSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ export const MarketSwitcher = () => {
setCurrentMarket(e.target.value as unknown as CustomMarket);
};

const marketBlurbs: { [key: string]: JSX.Element } = {
proto_mainnet_v3: (
<Trans>Main Ethereum market with the largest selection of assets and yield options</Trans>
),
proto_lido_v3: (
<Trans>Optimized for efficiency and risk by supporting blue-chip collateral assets</Trans>
),
};

return (
<TextField
select
Expand All @@ -149,60 +158,105 @@ 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 &&
(currentMarket === 'proto_mainnet_v3' || currentMarket === 'proto_lido_v3')
? 'Instance'
: ' 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',
wordWrap: 'break-word',
whiteSpace: 'normal',
lineHeight: 1.3,
maxWidth: '100%',
}}
>
{getMarketHelpData(market.marketTitle).name} {market.isFork ? 'Fork' : ''}
{upToLG && ' Market'}
{marketBlurbs[currentMarket]}
</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 +270,10 @@ export const MarketSwitcher = () => {
vertical: 'bottom',
horizontal: 'right',
},
transformOrigin: {
vertical: 'top',
horizontal: 'right',
},
PaperProps: {
style: {
minWidth: 240,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
customForumLink:
'https://governance.aave.com/t/arfc-pyusd-reserve-configuration-update-incentive-campaign/19573',
customMessage:
'Borrowing of some assets may impact the amount of rewards you are eligible for. Please check the forum post for the full eligibility criteria.'
'Borrowing of some assets may impact the amount of rewards you are eligible for. Please check the forum post for the full eligibility criteria.',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,10 @@ msgstr "MAI has been paused due to a community decision. Supply, borrows and rep
msgid "MAX"
msgstr "MAX"

#: src/components/MarketSwitcher.tsx
msgid "Main Ethereum market with the largest selection of assets and yield options"
msgstr "Main Ethereum market with the largest selection of assets and yield options"

#: src/components/transactions/Emode/EmodeModalContent.tsx
#: src/modules/dashboard/DashboardEModeButton.tsx
msgid "Manage E-Mode"
Expand Down Expand Up @@ -1740,6 +1744,10 @@ msgstr "Ok, Close"
msgid "Operation not supported"
msgstr "Operation not supported"

#: src/components/MarketSwitcher.tsx
msgid "Optimized for efficiency and risk by supporting blue-chip collateral assets"
msgstr "Optimized for efficiency and risk by supporting blue-chip collateral assets"

#: src/modules/reserve-overview/ReserveTopDetails.tsx
msgid "Oracle price"
msgstr "Oracle price"
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

1 comment on commit 695a536

@github-actions
Copy link

Choose a reason for hiding this comment

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

This commit was deployed on ipfs

Please sign in to comment.