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

staging deploy for apy evolution modal fix and links #2388

Merged
merged 6 commits into from
Sep 21, 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
2 changes: 1 addition & 1 deletion src/components-v2/InfluenceVault/InfluenceVaultUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const vaults: InfluenceVaultConfig[] = [
],
body2: [
'Unlike other Badger Vaults, graviAURA limits the times when users may withdraw their funds. Limited pre-unlock liquidity is available through Balancer pools containing graviAURA. Please carefully read the ',
'[User Guide](https://docs.badger.com/badger-finance/vaults/vault-user-guides-ethereum/vote-locked-cvx)',
'[User Guide](https://docs.badger.com/badger-finance/vaults/vault-user-guides-ethereum/graviaura-vote-locked-aura)',
' for more information.',
],
swapPercentageLabel: [],
Expand Down
12 changes: 6 additions & 6 deletions src/components-v2/VaultApyBreakdownItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => {
token={{ symbol: source.yieldVault ? source.yieldVault.token : source.name }}
/>
<Typography component="span">{`🚀 Boosted BADGER Rewards (max: ${numberWithCommas(
source.maxApr.toFixed(2),
source.maxApr?.toFixed(2),
)}%)`}</Typography>
</Box>
</Grid>
<Grid item xs={3}>
<Typography align="right">{`${numberWithCommas(sourceApr.toFixed(2))}%`}</Typography>
<Typography align="right">{`${numberWithCommas(sourceApr?.toFixed(2))}%`}</Typography>
</Grid>
</Grid>
</>
Expand Down Expand Up @@ -164,7 +164,7 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => {
</Box>
</Grid>
<Grid item xs={3}>
<Typography align="right">{numberWithCommas(source.apr.toFixed(2))}%</Typography>
<Typography align="right">{numberWithCommas(source.apr?.toFixed(2))}%</Typography>
</Grid>
</Grid>
</>
Expand All @@ -177,12 +177,12 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => {
<Grid item container justifyContent="space-between">
<Grid item>
<Typography variant="body2" display="inline" color="textSecondary">
{`🚀 Boosted BADGER Rewards (max: ${numberWithCommas(source.maxApr.toFixed(2))}%)`}
{`🚀 Boosted BADGER Rewards (max: ${numberWithCommas(source.maxApr?.toFixed(2))}%)`}
</Typography>
</Grid>
<Grid item>
<Typography variant="body2" display="inline" color="textSecondary">
{`${numberWithCommas(sourceApr.toFixed(2))}%`}
{`${numberWithCommas(sourceApr?.toFixed(2))}%`}
</Typography>
</Grid>
</Grid>
Expand Down Expand Up @@ -216,7 +216,7 @@ const VaultApyBreakdownItem = ({ vault, source }: Props): JSX.Element => {
</Grid>
<Grid item>
<Typography variant="body2" display="inline" color="textSecondary">
{`${numberWithCommas(sourceApr.toFixed(2))}%`}
{`${numberWithCommas(sourceApr?.toFixed(2))}%`}
</Typography>
</Grid>
</Grid>
Expand Down
12 changes: 6 additions & 6 deletions src/components-v2/VaultApyInformation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
</Grid>
<Grid item>
<Typography variant="subtitle1" display="inline" color="textSecondary">
{`${numberWithCommas(boost.toFixed(2))}%`}
{`${numberWithCommas(boost?.toFixed(2))}%`}
</Typography>
</Grid>
</Grid>
Expand All @@ -259,7 +259,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
</Grid>
<Grid item>
<Typography variant="subtitle1" display="inline" color="textSecondary">
{`${numberWithCommas(projectedBoost.toFixed(2))}%`}
{`${numberWithCommas(projectedBoost?.toFixed(2))}%`}
</Typography>
</Grid>
</Grid>
Expand All @@ -274,7 +274,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
</Grid>
<Grid item>
<Typography variant="body2" display="inline" color="textSecondary">
{token?.apr && `${numberWithCommas(token.apr.toFixed(2))}%`}
{token?.apr && `${numberWithCommas(token.apr?.toFixed(2))}%`}
</Typography>
</Grid>
</Grid>
Expand Down Expand Up @@ -318,10 +318,10 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
<>
{' '}
<Typography component="span">14-Day Historic APY</Typography>
<Typography>{numberWithCommas(boost.toFixed(2))}%</Typography>
<Typography>{numberWithCommas(boost?.toFixed(2))}%</Typography>
</>
) : (
<Typography> {numberWithCommas(projectedBoost.toFixed(2))}%</Typography>
<Typography> {numberWithCommas(projectedBoost?.toFixed(2))}%</Typography>
)}
</Box>
</Grid>
Expand Down Expand Up @@ -383,7 +383,7 @@ const VaultApyInformation = ({ open, onClose, boost, vault, projectedBoost }: Pr
</Grid>
<Grid item xs={3}>
<Typography align="right">
{numberWithCommas((vaults.getVault(yieldSource.vaultId)?.apy.baseYield ?? 0).toFixed(2))}%
{numberWithCommas((vaults.getVault(yieldSource.vaultId)?.apy.baseYield ?? 0)?.toFixed(2))}%
</Typography>
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components-v2/navbar/NavbarSocialContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const NavbarSocialContact = (): JSX.Element => {
<Grid container alignItems="center" justifyContent="flex-end">
<Grid item className={classes.iconContainer}>
<img
onClick={() => window.open('https://discord.gg/xZh7zkP8E7', '_blank')}
onClick={() => window.open('https://discord.gg/badgerdao', '_blank')}
className={classes.socialIcon}
alt="Discord Icon"
src="/assets/icons/discord.svg"
Expand Down
2 changes: 1 addition & 1 deletion src/components-v2/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Sidebar = observer(() => {
</Menu>
<div className={classes.socialsContainer}>
<img
onClick={() => window.open('https://discord.gg/xZh7zkP8E7', '_blank')}
onClick={() => window.open('https://discord.gg/badgerdao', '_blank')}
className={classes.socialIcon}
alt="Discord Icon"
src="/assets/icons/discord.svg"
Expand Down
5 changes: 4 additions & 1 deletion src/mobx/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export const numberWithCommas = (x: string): string => {
export const numberWithCommas = (x: string | undefined): string => {
if (x === undefined) {
return '';
}
const parts = x.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
return parts.join('.');
Expand Down