From 9fd3111c245a8d1ffda9f7a51f6093f5ebb09410 Mon Sep 17 00:00:00 2001 From: mrbasado <95517127+mrbasado@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:20:13 -0400 Subject: [PATCH] Legacy badger com changes (#2556) * feat: disable deposit on discontinued vaults * feat: hardcode no deposits * feat: updated announcment + removal of old text * feat: keep influence vaults open --- .../YieldBearingRewards.tsx | 3 - .../common/dialogs/VaultDeposit.tsx | 3 +- src/config/constants.ts | 7 +- src/mobx/stores/VaultStore.ts | 4 + src/pages/Landing.tsx | 3 +- src/tests/__snapshots__/Landing.test.tsx.snap | 2866 ++++++++--------- .../__snapshots__/Banner.test.tsx.snap | 56 +- src/ui-library/Banner.tsx | 16 +- 8 files changed, 1445 insertions(+), 1513 deletions(-) diff --git a/src/components-v2/YieldBearingVaults/YieldBearingRewards.tsx b/src/components-v2/YieldBearingVaults/YieldBearingRewards.tsx index 65bf02720..7f805b1fb 100644 --- a/src/components-v2/YieldBearingVaults/YieldBearingRewards.tsx +++ b/src/components-v2/YieldBearingVaults/YieldBearingRewards.tsx @@ -96,9 +96,6 @@ const YieldBearingRewards = observer(({ open, onModalClose }: YieldBearingReward the overall return on your deposits. No staking, locking, delegating, voting, bribing or claiming. Just earning. - - Do Less, Earn More. - ); diff --git a/src/components-v2/common/dialogs/VaultDeposit.tsx b/src/components-v2/common/dialogs/VaultDeposit.tsx index cc79c2fb3..00d37f734 100644 --- a/src/components-v2/common/dialogs/VaultDeposit.tsx +++ b/src/components-v2/common/dialogs/VaultDeposit.tsx @@ -158,7 +158,8 @@ export const VaultDeposit = observer(({ open = false, vault, depositAdvisory, on const deposit = TokenBalance.fromString(userBalance, amount === '' ? '0' : amount); const vaultCaps = user.vaultCaps[vault.vaultToken]; - let canDeposit = wallet.isConnected && !!amount && deposit.tokenBalance.gt(0); + let canDeposit: boolean = + wallet.isConnected && !!amount && deposit.tokenBalance.gt(0) && vault.state !== VaultState.Discontinued; if (canDeposit && vaultCaps) { const vaultHasSpace = vaultCaps.totalDepositCap.gte(deposit.tokenBalance); diff --git a/src/config/constants.ts b/src/config/constants.ts index 5a5fd776f..b5cede3e1 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -58,8 +58,9 @@ function stringHash(input?: string): string | undefined { } // Message should be defined or explicitly undefined. -export const APP_NEWS_MESSAGE = undefined; +export const APP_NEWS_MESSAGE = + 'app.badger.com has officially been migrated to legacy.badger.com and the discontinuation of all remaining vaults is in progress. To learn more about Badgers progression toward further decentralization '; // Text & URL should be defined or explicitly undefined. -export const APP_NEWS_URL_TEXT = 'Learn How.'; -export const APP_NEWS_URL = 'https://docs.badger.com/assistants/removing-exposure-to-renbtc'; +export const APP_NEWS_URL_TEXT = 'Click here'; +export const APP_NEWS_URL = 'https://badgerdao.medium.com/progressing-towards-further-decentralization-25351d4d240b'; export const APP_NEWS_STORAGE_HASH = stringHash(APP_NEWS_MESSAGE); diff --git a/src/mobx/stores/VaultStore.ts b/src/mobx/stores/VaultStore.ts index dbd244e4c..b4257c217 100644 --- a/src/mobx/stores/VaultStore.ts +++ b/src/mobx/stores/VaultStore.ts @@ -273,6 +273,10 @@ export default class VaultStore { return false; } + if (vault.state === VaultState.Discontinued) { + return false; + } + return this.store.user.onGuestList(vault); } diff --git a/src/pages/Landing.tsx b/src/pages/Landing.tsx index c66efef71..52749a6f1 100644 --- a/src/pages/Landing.tsx +++ b/src/pages/Landing.tsx @@ -1,5 +1,4 @@ import { makeStyles } from '@material-ui/core/styles'; -import VaultListTitle from 'components-v2/landing/VaultListTitle'; import { observer } from 'mobx-react-lite'; import React from 'react'; @@ -17,7 +16,7 @@ const Landing = observer(() => { const classes = useStyles(); return ( - + {/* */} diff --git a/src/tests/__snapshots__/Landing.test.tsx.snap b/src/tests/__snapshots__/Landing.test.tsx.snap index 831c73185..9a27a8c3e 100644 --- a/src/tests/__snapshots__/Landing.test.tsx.snap +++ b/src/tests/__snapshots__/Landing.test.tsx.snap @@ -5,50 +5,32 @@ exports[`Landing Renders correctly 1`] = `
-

- Do Less & Earn More -

-

- Deposit to earn - - Yield-Bearing Rewards - - - that automate and optimize yield from Aura and Convex positions -

Vault

APY

My Deposits

TVL

CVX logo
bveCVX
Convex @@ -591,32 +573,32 @@ exports[`Landing Renders correctly 1`] = `

$6,450.00

$13,738,345

@@ -666,20 +648,20 @@ exports[`Landing Renders correctly 1`] = `
cvxCRV logo
cvxCRV
Convex
Ecosystem Helper
🚀 Boosted @@ -739,32 +721,32 @@ exports[`Landing Renders correctly 1`] = `

$1,712.37

$3,609,918

@@ -814,20 +796,20 @@ exports[`Landing Renders correctly 1`] = `
AURA logo
graviAURA
Aura @@ -861,32 +843,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$2,753,168

@@ -936,20 +918,20 @@ exports[`Landing Renders correctly 1`] = `
auraBAL logo
auraBAL
Aura
Ecosystem Helper @@ -996,32 +978,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$836,428

@@ -1071,34 +1053,34 @@ exports[`Landing Renders correctly 1`] = `
auraBAL logo graviAURA logo WETH logo
graviAURA/auraBAL/WETH
Aura @@ -1132,32 +1114,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$106,996

@@ -1207,27 +1189,27 @@ exports[`Landing Renders correctly 1`] = `
WBTC logo BADGER logo
BADGER/WBTC
Aura @@ -1261,32 +1243,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$2,739,793

@@ -1336,34 +1318,34 @@ exports[`Landing Renders correctly 1`] = `
WBTC logo DIGG logo graviAURA logo
graviAURA/DIGG/WBTC
Aura @@ -1397,32 +1379,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$744,657

@@ -1472,27 +1454,27 @@ exports[`Landing Renders correctly 1`] = `
CVX logo bveCVX logo
CVX/bveCVX
Curve @@ -1526,32 +1508,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$832,345

@@ -1601,27 +1583,27 @@ exports[`Landing Renders correctly 1`] = `
wibBTC logo crvRenWSBTC logo
ibBTC/crvsBTC
Convex
🚀 Boosted @@ -1668,32 +1650,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$19,814,734

@@ -1743,27 +1725,27 @@ exports[`Landing Renders correctly 1`] = `
BADGER logo WBTC logo
BADGER/WBTC
Convex @@ -1797,32 +1779,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$2,708,612

@@ -1872,27 +1854,27 @@ exports[`Landing Renders correctly 1`] = `
WBTC logo BADGER logo
wBTC/Badger
Sushiswap @@ -1926,22 +1908,22 @@ exports[`Landing Renders correctly 1`] = `

7.03%

apy info icon

$0

$1,224,135

@@ -1978,20 +1960,20 @@ exports[`Landing Renders correctly 1`] = `
WBTC logo
wBTC
Yearn @@ -2025,22 +2007,22 @@ exports[`Landing Renders correctly 1`] = `

0.00%

apy info icon

$0

$1,565,378

@@ -2077,27 +2059,27 @@ exports[`Landing Renders correctly 1`] = `
WBTC logo WETH logo
wBTC/wETH
Sushiswap @@ -2131,22 +2113,22 @@ exports[`Landing Renders correctly 1`] = `

2.23%

apy info icon

$0

$7,835,152

@@ -2183,34 +2165,34 @@ exports[`Landing Renders correctly 1`] = `
bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo
bb-a-USD
Aura @@ -2244,32 +2226,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$204,737

@@ -2319,27 +2301,27 @@ exports[`Landing Renders correctly 1`] = `
renBTC logo WBTC logo
renBTC/wBTC
Convex @@ -2373,32 +2355,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$13,628,486

@@ -2448,34 +2430,34 @@ exports[`Landing Renders correctly 1`] = `
USDT logo WBTC logo WETH logo
Tricrypto2
Convex @@ -2509,32 +2491,32 @@ exports[`Landing Renders correctly 1`] = `

$0

$817,047

@@ -2592,52 +2574,34 @@ exports[`Landing Renders mobile version correctly 1`] = `
-

- Do Less & Earn More -

-

- Deposit to earn - - Yield-Bearing Rewards - - - that automate and optimize yield from Aura and Convex positions -

Vault

APY

My Deposits

TVL

CVX logo
bveCVX

APY

My Deposits

$6,450.00

@@ -2916,19 +2880,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex @@ -2938,63 +2902,63 @@ exports[`Landing Renders mobile version correctly 1`] = `
cvxCRV logo
cvxCRV

APY

My Deposits

$1,712.37

@@ -3035,45 +2999,45 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex
Ecosystem Helper
🚀 Boosted @@ -3083,63 +3047,63 @@ exports[`Landing Renders mobile version correctly 1`] = `
AURA logo
graviAURA

APY

My Deposits

$0

@@ -3180,19 +3144,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura @@ -3202,63 +3166,63 @@ exports[`Landing Renders mobile version correctly 1`] = `
auraBAL logo
auraBAL

APY

My Deposits

$0

@@ -3299,32 +3263,32 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura
Ecosystem Helper @@ -3334,77 +3298,77 @@ exports[`Landing Renders mobile version correctly 1`] = `
auraBAL logo graviAURA logo WETH logo
graviAURA/auraBAL/WETH

APY

My Deposits

$0

@@ -3445,19 +3409,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura @@ -3467,70 +3431,70 @@ exports[`Landing Renders mobile version correctly 1`] = `
WBTC logo BADGER logo
BADGER/WBTC

APY

My Deposits

$0

@@ -3571,19 +3535,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura @@ -3593,77 +3557,77 @@ exports[`Landing Renders mobile version correctly 1`] = `
WBTC logo DIGG logo graviAURA logo
graviAURA/DIGG/WBTC

APY

My Deposits

$0

@@ -3704,19 +3668,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura @@ -3726,70 +3690,70 @@ exports[`Landing Renders mobile version correctly 1`] = `
CVX logo bveCVX logo
CVX/bveCVX

APY

My Deposits

$0

@@ -3830,19 +3794,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Curve @@ -3852,70 +3816,70 @@ exports[`Landing Renders mobile version correctly 1`] = `
wibBTC logo crvRenWSBTC logo
ibBTC/crvsBTC

APY

My Deposits

$0

@@ -3956,32 +3920,32 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex
🚀 Boosted @@ -3991,70 +3955,70 @@ exports[`Landing Renders mobile version correctly 1`] = `
BADGER logo WBTC logo
BADGER/WBTC

APY

My Deposits

$0

@@ -4095,19 +4059,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex @@ -4117,60 +4081,60 @@ exports[`Landing Renders mobile version correctly 1`] = `
WBTC logo BADGER logo
wBTC/Badger

APY

7.03%

apy info icon

My Deposits

$0

@@ -4198,19 +4162,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Sushiswap @@ -4220,53 +4184,53 @@ exports[`Landing Renders mobile version correctly 1`] = `
WBTC logo
wBTC

APY

0.00%

apy info icon

My Deposits

$0

@@ -4294,19 +4258,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Yearn @@ -4316,60 +4280,60 @@ exports[`Landing Renders mobile version correctly 1`] = `
WBTC logo WETH logo
wBTC/wETH

APY

2.23%

apy info icon

My Deposits

$0

@@ -4397,19 +4361,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Sushiswap @@ -4419,77 +4383,77 @@ exports[`Landing Renders mobile version correctly 1`] = `
bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo
bb-a-USD

APY

My Deposits

$0

@@ -4530,19 +4494,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Aura @@ -4552,70 +4516,70 @@ exports[`Landing Renders mobile version correctly 1`] = `
renBTC logo WBTC logo
renBTC/wBTC

APY

My Deposits

$0

@@ -4656,19 +4620,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex @@ -4678,77 +4642,77 @@ exports[`Landing Renders mobile version correctly 1`] = `
USDT logo WBTC logo WETH logo
Tricrypto2

APY

My Deposits

$0

@@ -4789,19 +4753,19 @@ exports[`Landing Renders mobile version correctly 1`] = `
Convex @@ -4819,52 +4783,34 @@ exports[`Landing Renders tablet version correctly 1`] = `
-

- Do Less & Earn More -

-

- Deposit to earn - - Yield-Bearing Rewards - - - that automate and optimize yield from Aura and Convex positions -

Vault

APY

My Deposits

TVL

CVX logo
bveCVX

APY

My Deposits

$6,450.00

@@ -5143,19 +5089,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Convex @@ -5165,63 +5111,63 @@ exports[`Landing Renders tablet version correctly 1`] = `
cvxCRV logo
cvxCRV

APY

My Deposits

$1,712.37

@@ -5262,45 +5208,45 @@ exports[`Landing Renders tablet version correctly 1`] = `
Convex
Ecosystem Helper
🚀 Boosted @@ -5310,63 +5256,63 @@ exports[`Landing Renders tablet version correctly 1`] = `
AURA logo
graviAURA

APY

My Deposits

$0

@@ -5407,19 +5353,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura @@ -5429,63 +5375,63 @@ exports[`Landing Renders tablet version correctly 1`] = `
auraBAL logo
auraBAL

APY

My Deposits

$0

@@ -5526,32 +5472,32 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura
Ecosystem Helper @@ -5561,77 +5507,77 @@ exports[`Landing Renders tablet version correctly 1`] = `
auraBAL logo graviAURA logo WETH logo
graviAURA/auraBAL/WETH

APY

My Deposits

$0

@@ -5672,19 +5618,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura @@ -5694,70 +5640,70 @@ exports[`Landing Renders tablet version correctly 1`] = `
WBTC logo BADGER logo
BADGER/WBTC

APY

My Deposits

$0

@@ -5798,19 +5744,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura @@ -5820,77 +5766,77 @@ exports[`Landing Renders tablet version correctly 1`] = `
WBTC logo DIGG logo graviAURA logo
graviAURA/DIGG/WBTC

APY

My Deposits

$0

@@ -5931,19 +5877,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura @@ -5953,70 +5899,70 @@ exports[`Landing Renders tablet version correctly 1`] = `
CVX logo bveCVX logo
CVX/bveCVX

APY

My Deposits

$0

@@ -6057,19 +6003,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Curve @@ -6079,70 +6025,70 @@ exports[`Landing Renders tablet version correctly 1`] = `
wibBTC logo crvRenWSBTC logo
ibBTC/crvsBTC

APY

My Deposits

$0

@@ -6183,32 +6129,32 @@ exports[`Landing Renders tablet version correctly 1`] = `
Convex
🚀 Boosted @@ -6218,70 +6164,70 @@ exports[`Landing Renders tablet version correctly 1`] = `
BADGER logo WBTC logo
BADGER/WBTC

APY

My Deposits

$0

@@ -6322,19 +6268,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Convex @@ -6344,60 +6290,60 @@ exports[`Landing Renders tablet version correctly 1`] = `
WBTC logo BADGER logo
wBTC/Badger

APY

7.03%

apy info icon

My Deposits

$0

@@ -6425,19 +6371,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Sushiswap @@ -6447,53 +6393,53 @@ exports[`Landing Renders tablet version correctly 1`] = `
WBTC logo
wBTC

APY

0.00%

apy info icon

My Deposits

$0

@@ -6521,19 +6467,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Yearn @@ -6543,60 +6489,60 @@ exports[`Landing Renders tablet version correctly 1`] = `
WBTC logo WETH logo
wBTC/wETH

APY

2.23%

apy info icon

My Deposits

$0

@@ -6624,19 +6570,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Sushiswap @@ -6646,77 +6592,77 @@ exports[`Landing Renders tablet version correctly 1`] = `
bb-a-USDT logo bb-a-DAI logo bb-a-USDC logo
bb-a-USD

APY

My Deposits

$0

@@ -6757,19 +6703,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Aura @@ -6779,70 +6725,70 @@ exports[`Landing Renders tablet version correctly 1`] = `
renBTC logo WBTC logo
renBTC/wBTC

APY

My Deposits

$0

@@ -6883,19 +6829,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
Convex @@ -6905,77 +6851,77 @@ exports[`Landing Renders tablet version correctly 1`] = `
USDT logo WBTC logo WETH logo
Tricrypto2

APY

My Deposits

$0

@@ -7016,19 +6962,19 @@ exports[`Landing Renders tablet version correctly 1`] = `
diff --git a/src/ui-library/Banner.tsx b/src/ui-library/Banner.tsx index e9ce8b8f9..9dc16c7d4 100644 --- a/src/ui-library/Banner.tsx +++ b/src/ui-library/Banner.tsx @@ -58,17 +58,13 @@ const Banner = ({ message, link, linkText, closeElement = null }: BannerProps): const classes = useStyles(); return ( - - - {message} - + + {message} {link && linkText && ( - - - banner link icon - {linkText} - - + + banner link icon + {linkText} + )} {!!closeElement && (