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

Apy modal | Fixed alignment issue for mobile #2347

Merged
merged 2 commits into from
Sep 8, 2022
Merged
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
1 change: 1 addition & 0 deletions public/assets/icons/curve lp fees.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/icons/sushiswap lp fees.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions src/components-v2/VaultApyBreakdownItem/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
},
Expand All @@ -33,13 +33,21 @@ const useStyles = makeStyles({
padding: 10,
'& .MuiBox-root > *': {
marginRight: 5,
'&:last-child': {
marginRight: 0,
},
},
'& .MuiBox-root > img': {
'& .MuiBox-root > img:first-child': {
marginRight: 10,
},
},
earnedAs: { color: 'rgba(255,255,255,0.6)' },
});
yieldSourceRow: {
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
},
}));

interface Props {
vault: VaultDTO;
Expand Down Expand Up @@ -100,7 +108,7 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => {
<>
<Grid container className={classes.totalVaultRewardsRow}>
<Grid item xs={9}>
<Box display="flex" alignItems="center">
<Box display="flex" alignItems="center" className={classes.yieldSourceRow}>
<TokenLogo
width="24"
height="24"
Expand Down
13 changes: 9 additions & 4 deletions src/components-v2/VaultApyInformation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -100,6 +100,11 @@ const useStyles = makeStyles((theme) => ({
marginTop: 20,
borderRadius: 10,
},
yieldSourceRow: {
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
},
},
}));

interface Props {
Expand Down Expand Up @@ -334,7 +339,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
<Divider className={classes.totalVaultRewardsDivider} />
<Grid container className={classes.totalVaultRewardsRow}>
<Grid item xs={9}>
<Box display="flex" alignItems="center">
<Box display="flex" alignItems="center" className={classes.yieldSourceRow}>
<TokenLogo width="24" height="24" token={{ symbol: yieldSource.vaultName }} />
<img
width="12"
Expand Down
5 changes: 4 additions & 1 deletion src/components-v2/landing/VaultItemApr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const useStyles = makeStyles((theme: Theme) => ({
[theme.breakpoints.down('sm')]: {
justifyContent: 'flex-start',
},
'&:hover': {
textDecoration: 'underline',
},
},
projectedApr: {
fontSize: 10,
Expand Down Expand Up @@ -127,7 +130,7 @@ const VaultItemApr = ({ vault }: Props): JSX.Element => {
<Box className={classes.yieldBearingRewards}>
<Link color="primary" onClick={handleYieldBearingRewardsClick}>
<img width="9" src="assets/icons/yield-bearing-rewards.svg" alt="Yield-Bearing Rewards" /> Yield-Bearing
Rewards.
Rewards:
</Link>
<Typography onClick={handleApyInfoClick} variant="inherit">
Rewards earn up to {yieldSourcesAprTotal.toFixed(2)}%
Expand Down
Loading