From 0a728b50d51304b2736a839dfe291f35f03b3496 Mon Sep 17 00:00:00 2001 From: Anil Kumar Rai Date: Thu, 8 Sep 2022 20:11:15 +0530 Subject: [PATCH 1/2] fixed apymodal alignment issue for mobile --- .../VaultApyBreakdownItem/index.tsx | 13 +- .../VaultApyInformation/index.tsx | 7 +- src/tests/__snapshots__/Landing.test.tsx.snap | 742 +++++++++--------- .../VaultListDisplay.test.tsx.snap | 192 ++--- 4 files changed, 482 insertions(+), 472 deletions(-) diff --git a/src/components-v2/VaultApyBreakdownItem/index.tsx b/src/components-v2/VaultApyBreakdownItem/index.tsx index 653c2cf14..ef1ff62f4 100644 --- a/src/components-v2/VaultApyBreakdownItem/index.tsx +++ b/src/components-v2/VaultApyBreakdownItem/index.tsx @@ -1,5 +1,5 @@ import { VaultDTO } from '@badger-dao/sdk'; -import { Box, Grid, Link, makeStyles, Typography } from '@material-ui/core'; +import { Box, Grid, Link, makeStyles, Theme, Typography } from '@material-ui/core'; import TokenLogo from 'components-v2/TokenLogo'; import { YieldValueSource } from 'components-v2/VaultApyInformation'; import { getYieldBearingVaultBySourceName } from 'components-v2/YieldBearingVaults/YieldBearingVaultUtil'; @@ -16,7 +16,7 @@ import routes from '../../config/routes'; import { useVaultInformation } from '../../hooks/useVaultInformation'; import { numberWithCommas } from '../../mobx/utils/helpers'; -const useStyles = makeStyles({ +const useStyles = makeStyles((theme: Theme) => ({ apyBreakdownIcon: { marginRight: 8, }, @@ -39,7 +39,12 @@ const useStyles = makeStyles({ }, }, earnedAs: { color: 'rgba(255,255,255,0.6)' }, -}); + yieldSourceRow: { + [theme.breakpoints.down('sm')]: { + flexWrap: 'wrap', + }, + }, +})); interface Props { vault: VaultDTO; @@ -100,7 +105,7 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => { <> - + ({ marginTop: 20, borderRadius: 10, }, + yieldSourceRow: { + [theme.breakpoints.down('sm')]: { + flexWrap: 'wrap', + }, + }, })); interface Props { @@ -334,7 +339,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr - + @@ -399,7 +399,7 @@ exports[`Landing Renders correctly 1`] = ` @@ -434,7 +434,7 @@ exports[`Landing Renders correctly 1`] = ` CLEAR ALL @@ -473,7 +473,7 @@ exports[`Landing Renders correctly 1`] = ` /> @@ -501,7 +501,7 @@ exports[`Landing Renders correctly 1`] = ` /> @@ -529,7 +529,7 @@ exports[`Landing Renders correctly 1`] = ` /> @@ -557,7 +557,7 @@ exports[`Landing Renders correctly 1`] = ` /> @@ -628,7 +628,7 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

auraBAL logo graviAURA logo WETH logo

@@ -1057,10 +1057,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

WBTC logo BADGER logo

@@ -1184,10 +1184,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

WBTC logo DIGG logo graviAURA logo

@@ -1316,10 +1316,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

CVX logo bveCVX logo

@@ -1430,10 +1430,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

wibBTC logo crvRenWSBTC logo

@@ -1543,10 +1543,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

BADGER logo WBTC logo

@@ -1643,10 +1643,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

WBTC logo BADGER logo

@@ -1743,10 +1743,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

WBTC logo

@@ -1847,7 +1847,7 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

WBTC logo WETH logo

@@ -1925,10 +1925,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo

@@ -2056,10 +2056,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

renBTC logo WBTC logo

@@ -2170,10 +2170,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

USDT logo WBTC logo WETH logo

@@ -2275,10 +2275,10 @@ exports[`Landing Renders correctly 1`] = ` class="MuiGrid-root-42 MuiGrid-container-43 MuiGrid-item-44 MuiGrid-align-items-xs-center-51 MuiGrid-justify-content-xs-flex-end-61 MuiGrid-grid-xs-true-76" >

@@ -2448,7 +2448,7 @@ exports[`Landing Renders mobile version correctly 1`] = ` />
@@ -2476,7 +2476,7 @@ exports[`Landing Renders mobile version correctly 1`] = ` />
@@ -2504,7 +2504,7 @@ exports[`Landing Renders mobile version correctly 1`] = ` />
@@ -2532,14 +2532,14 @@ exports[`Landing Renders mobile version correctly 1`] = ` />
bveCVX

cvxCRV

graviAURA

auraBAL

auraBAL logo graviAURA logo WETH logo
graviAURA/auraBAL/WETH

WBTC logo BADGER logo
BADGER/WBTC

WBTC logo DIGG logo graviAURA logo
graviAURA/DIGG/WBTC

CVX logo bveCVX logo
CVX/bveCVX

wibBTC logo crvRenWSBTC logo
ibBTC/crvsBTC

BADGER logo WBTC logo
BADGER/WBTC

WBTC logo BADGER logo
wBTC/Badger

WBTC logo
wBTC

WBTC logo WETH logo
wBTC/wETH

bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo
bb-a-USD

renBTC logo WBTC logo
renBTC/wBTC

USDT logo WBTC logo WETH logo
Tricrypto2

@@ -4375,7 +4375,7 @@ exports[`Landing Renders tablet version correctly 1`] = ` />
@@ -4403,7 +4403,7 @@ exports[`Landing Renders tablet version correctly 1`] = ` />
@@ -4431,7 +4431,7 @@ exports[`Landing Renders tablet version correctly 1`] = ` />
@@ -4459,14 +4459,14 @@ exports[`Landing Renders tablet version correctly 1`] = ` />
bveCVX

cvxCRV

graviAURA

auraBAL

auraBAL logo graviAURA logo WETH logo
graviAURA/auraBAL/WETH

WBTC logo BADGER logo
BADGER/WBTC

WBTC logo DIGG logo graviAURA logo
graviAURA/DIGG/WBTC

CVX logo bveCVX logo
CVX/bveCVX

wibBTC logo crvRenWSBTC logo
ibBTC/crvsBTC

BADGER logo WBTC logo
BADGER/WBTC

WBTC logo BADGER logo
wBTC/Badger

WBTC logo
wBTC

WBTC logo WETH logo
wBTC/wETH

bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo
bb-a-USD

renBTC logo WBTC logo
renBTC/wBTC

USDT logo WBTC logo WETH logo
Tricrypto2

@@ -367,7 +367,7 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` />
@@ -395,7 +395,7 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` />
@@ -423,7 +423,7 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` />
@@ -589,7 +589,7 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

auraBAL logo graviAURA logo WETH logo

@@ -903,10 +903,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

WBTC logo BADGER logo

@@ -1030,10 +1030,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

WBTC logo DIGG logo graviAURA logo

@@ -1162,10 +1162,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

CVX logo bveCVX logo

@@ -1276,10 +1276,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

wibBTC logo crvRenWSBTC logo

@@ -1504,10 +1504,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

BADGER logo WBTC logo

@@ -1604,10 +1604,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

WBTC logo BADGER logo

@@ -1704,10 +1704,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

WBTC logo

@@ -1808,7 +1808,7 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

WBTC logo WETH logo

@@ -1886,10 +1886,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo

@@ -2017,10 +2017,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

renBTC logo WBTC logo

@@ -2131,10 +2131,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

USDT logo WBTC logo WETH logo

@@ -2236,10 +2236,10 @@ exports[`VaultListDisplay uses default sort criteria by default 1`] = ` class="MuiGrid-root-13 MuiGrid-container-14 MuiGrid-item-15 MuiGrid-align-items-xs-center-22 MuiGrid-justify-content-xs-flex-end-32 MuiGrid-grid-xs-true-47" >

Date: Thu, 8 Sep 2022 21:23:20 +0530 Subject: [PATCH 2/2] fixed UI based on feadback --- public/assets/icons/curve lp fees.svg | 1 + public/assets/icons/sushiswap lp fees.svg | 1 + src/components-v2/VaultApyBreakdownItem/index.tsx | 5 ++++- src/components-v2/VaultApyInformation/index.tsx | 6 +++--- src/components-v2/landing/VaultItemApr.tsx | 5 ++++- 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 public/assets/icons/curve lp fees.svg create mode 100644 public/assets/icons/sushiswap lp fees.svg diff --git a/public/assets/icons/curve lp fees.svg b/public/assets/icons/curve lp fees.svg new file mode 100644 index 000000000..fe4343ae4 --- /dev/null +++ b/public/assets/icons/curve lp fees.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/icons/sushiswap lp fees.svg b/public/assets/icons/sushiswap lp fees.svg new file mode 100644 index 000000000..fe4343ae4 --- /dev/null +++ b/public/assets/icons/sushiswap lp fees.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components-v2/VaultApyBreakdownItem/index.tsx b/src/components-v2/VaultApyBreakdownItem/index.tsx index ef1ff62f4..661cabecf 100644 --- a/src/components-v2/VaultApyBreakdownItem/index.tsx +++ b/src/components-v2/VaultApyBreakdownItem/index.tsx @@ -33,8 +33,11 @@ const useStyles = makeStyles((theme: Theme) => ({ padding: 10, '& .MuiBox-root > *': { marginRight: 5, + '&:last-child': { + marginRight: 0, + }, }, - '& .MuiBox-root > img': { + '& .MuiBox-root > img:first-child': { marginRight: 10, }, }, diff --git a/src/components-v2/VaultApyInformation/index.tsx b/src/components-v2/VaultApyInformation/index.tsx index 02e93a791..7bc46e94c 100644 --- a/src/components-v2/VaultApyInformation/index.tsx +++ b/src/components-v2/VaultApyInformation/index.tsx @@ -72,13 +72,13 @@ const useStyles = makeStyles((theme) => ({ totalVaultRewardsRow: { padding: 10, '& .MuiBox-root > *': { - marginRight: 10, + marginRight: 5, '&:last-child': { marginRight: 0, }, }, - '& .MuiBox-root > img': { - marginRight: 5, + '& .MuiBox-root > img:first-child': { + marginRight: 10, }, }, rowAsHead: { diff --git a/src/components-v2/landing/VaultItemApr.tsx b/src/components-v2/landing/VaultItemApr.tsx index de527203b..29942ccb2 100644 --- a/src/components-v2/landing/VaultItemApr.tsx +++ b/src/components-v2/landing/VaultItemApr.tsx @@ -28,6 +28,9 @@ const useStyles = makeStyles((theme: Theme) => ({ [theme.breakpoints.down('sm')]: { justifyContent: 'flex-start', }, + '&:hover': { + textDecoration: 'underline', + }, }, projectedApr: { fontSize: 10, @@ -127,7 +130,7 @@ const VaultItemApr = ({ vault }: Props): JSX.Element => { Yield-Bearing Rewards Yield-Bearing - Rewards. + Rewards: Rewards earn up to {yieldSourcesAprTotal.toFixed(2)}%