Skip to content

feat: umbrella #2321

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

Merged
merged 189 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
04c51de
feat: init umbrella
foodaka Jan 9, 2025
7a101b5
feat: separate sections
foodaka Jan 9, 2025
0242e76
feat: init data provider service
grothem Jan 9, 2025
3a3d959
Merge branch 'feat/umbrella' into feat/data-provider-service
grothem Jan 9, 2025
f47be93
fix: addresses
grothem Jan 9, 2025
3c37253
fix: package json
grothem Jan 9, 2025
2a21c6a
feat: updated provider
grothem Jan 10, 2025
fe0dd11
chore: org folders
foodaka Jan 10, 2025
06e18fa
fix: latest provider
grothem Jan 10, 2025
8397972
feat: udated provider
grothem Jan 10, 2025
dc8b0ba
chore: user stake list vars
foodaka Jan 13, 2025
99d8e26
fix: underlying decimals
grothem Jan 13, 2025
59064ae
feat: lint
JoaquinBattilana Jan 15, 2025
74e3c09
feat: added basic selectors
JoaquinBattilana Jan 16, 2025
c020cd7
feat: added new interfaces + types
JoaquinBattilana Jan 16, 2025
4cb9eb4
feat: balance breakdown
foodaka Jan 16, 2025
c2f23c1
feat: basic stake list
JoaquinBattilana Jan 16, 2025
a83d4e1
Feat: merged with main
JoaquinBattilana Jan 16, 2025
26197e6
feat: useUmbrellaSummary
JoaquinBattilana Jan 16, 2025
621d9e5
feat: integrate apy
foodaka Jan 16, 2025
b2304e8
feat: sync conflicts
foodaka Jan 16, 2025
0330be0
chore: fix conflict
foodaka Jan 16, 2025
62a0a1a
feat: basic modal content umbrella
JoaquinBattilana Jan 16, 2025
5734646
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
JoaquinBattilana Jan 16, 2025
3f7ecc2
feat: basic stake tx
JoaquinBattilana Jan 17, 2025
b3fb0fe
chore: fix sort
foodaka Jan 17, 2025
c280955
chore: fix sort
foodaka Jan 17, 2025
94f8bdf
chore: some cleanup
foodaka Jan 17, 2025
43ef57e
feat: multi tokens
grothem Jan 17, 2025
86f5871
feat: list item components
grothem Jan 17, 2025
6cd8c71
fix: cleanup
grothem Jan 17, 2025
fe62df0
feat: underlying stake token info
grothem Jan 17, 2025
f4d5a84
feat: available to claim item
grothem Jan 17, 2025
c073249
feat: updated provider
grothem Jan 17, 2025
d660d46
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jan 20, 2025
251c47d
chore: some cleanup
foodaka Jan 20, 2025
28e2d9e
chore: fix mobile layout
foodaka Jan 20, 2025
81d1a22
chore: some cleanup
foodaka Jan 20, 2025
2fc6b35
chore: cleanup files
foodaka Jan 20, 2025
040d053
feat: action buttons
grothem Jan 21, 2025
62003de
feat: amount staked, token price
grothem Jan 21, 2025
32a2140
feat: net umbrella balance
foodaka Jan 22, 2025
6a9ec3f
chore: sync changes
foodaka Jan 22, 2025
eea55b3
feat: apys
foodaka Jan 22, 2025
500bae0
fix: apy
foodaka Jan 22, 2025
5356bb3
feat: cooldown
grothem Jan 22, 2025
7ff0402
fix: build
grothem Jan 22, 2025
1665de7
feat: basic permit functions
JoaquinBattilana Jan 23, 2025
b1ad21a
feat: eslint
JoaquinBattilana Jan 23, 2025
2a13c79
Feat: merge with base
JoaquinBattilana Jan 23, 2025
18dddb3
feat: dropdown actions
foodaka Jan 23, 2025
65ae2b2
feat: sync cooldown
foodaka Jan 23, 2025
932096e
feat: cleanup
foodaka Jan 23, 2025
f35226d
chore: type fixes
foodaka Jan 23, 2025
1648017
fix: mobile views
foodaka Jan 23, 2025
861f7cc
fix: loading states
foodaka Jan 24, 2025
a3dcdad
feat: basic umbrella claim modal
JoaquinBattilana Jan 24, 2025
e0d19b1
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
JoaquinBattilana Jan 24, 2025
6b34886
feat: unstake, stake token service
grothem Jan 24, 2025
c10ec97
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jan 27, 2025
3c8078d
fix: search umbrella assets
foodaka Jan 27, 2025
8d4cf4e
feat: cooldown and unstake time
grothem Jan 28, 2025
e7ff5e6
fix: cooldown timers
grothem Jan 28, 2025
3a4a24f
fix: apy tooltips
grothem Jan 28, 2025
ec99536
feat: claim txs
JoaquinBattilana Jan 28, 2025
d985926
feat: merged with main
JoaquinBattilana Jan 28, 2025
698dfdb
feat: lint fix
JoaquinBattilana Jan 28, 2025
ef77f3b
fix: claim tooltip
grothem Jan 28, 2025
dabc5be
fix: cooldown buttons
grothem Jan 28, 2025
970e91d
feat: ui cleanup
grothem Jan 29, 2025
63bcd7a
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jan 29, 2025
d60ef98
fix: sorting
foodaka Jan 29, 2025
6e781f7
feat: preview redeem
grothem Jan 30, 2025
af05fe3
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jan 30, 2025
c631b52
fix: token icons
foodaka Jan 30, 2025
9e235d9
feat: check balance on aTokens (#2327)
foodaka Jan 30, 2025
5d7ee7e
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jan 30, 2025
5d32ba0
fix: token symbol
grothem Jan 30, 2025
62bde3b
feat: show hf change on stake
grothem Jan 31, 2025
f9f1c56
fix: token spacing
grothem Jan 31, 2025
1a5d504
fix: icon color
grothem Jan 31, 2025
b5cdc7d
fix: cooldown
grothem Jan 31, 2025
1e6405d
fix: cleanup
grothem Jan 31, 2025
cb9037d
fix: non waToken stake
grothem Jan 31, 2025
0b57a41
fix: cleanup
grothem Feb 3, 2025
37b41ec
Feat: updated stake gateway
JoaquinBattilana Feb 3, 2025
85ae8c6
fix: cursor
grothem Feb 3, 2025
5c1c33a
fix: mobile, cleanup
grothem Feb 3, 2025
9ab4a39
fix: column width
grothem Feb 3, 2025
e18457e
fix: timers
grothem Feb 3, 2025
7d08dc3
feat: no connected account view
grothem Feb 5, 2025
e233198
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 5, 2025
a54ed31
feat: mobile default view
grothem Feb 5, 2025
3ccca89
feat: default header
grothem Feb 5, 2025
bcd6675
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 5, 2025
be0d489
feat: no assets configured message
grothem Feb 5, 2025
e8e04fa
fix: skeleton loaders
grothem Feb 5, 2025
8c8efb5
Feat/deployment sep umbrella (#2337)
foodaka Feb 5, 2025
27e0f92
fix: lint
grothem Feb 5, 2025
a0205aa
fix: cleanup
grothem Feb 6, 2025
163e48b
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 6, 2025
71f7b3a
fix: adds whitespace
foodaka Feb 6, 2025
37ffbc0
fix: approval amounts
grothem Feb 6, 2025
dfb5f35
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 6, 2025
9c30490
fix: summary calc cleanup
grothem Feb 6, 2025
cfe4f03
fix: allow claim if unclaimed rewards
grothem Feb 6, 2025
2b048c3
fix: aToken balance available to stake
grothem Feb 6, 2025
8c92735
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 7, 2025
70236f6
Feat/umbrella utils (#2366)
JoaquinBattilana Feb 18, 2025
8f6eb54
fix: helpers
grothem Feb 17, 2025
a20993d
fix: waToken rename
grothem Feb 18, 2025
ee0907d
Merge branch 'main' into feat/umbrella
grothem Feb 18, 2025
5b15bae
fix: wa token naming
grothem Feb 18, 2025
91c2bba
feat: stake native tokens
JoaquinBattilana Feb 19, 2025
8929d64
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 19, 2025
43cc586
feat: redeem as eth
JoaquinBattilana Feb 19, 2025
2e868e2
feat: usePoolOracles and claim usd amount
JoaquinBattilana Feb 19, 2025
4425c2a
feat: order stake assets in modal by balance + naming underlying no s…
JoaquinBattilana Feb 19, 2025
91d2ad1
feat: preview stake amount
grothem Feb 19, 2025
6a4a2c6
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Feb 20, 2025
f0249ed
chore: move rewards umbrella to stake config
foodaka Feb 20, 2025
d520e6e
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
JoaquinBattilana Feb 27, 2025
ce65881
feat: icons
JoaquinBattilana Feb 27, 2025
0f633bd
feat: updated data provider
grothem Mar 3, 2025
af9b3ba
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
JoaquinBattilana Mar 3, 2025
0b1c6bb
feat: added new batch contract
JoaquinBattilana Mar 3, 2025
3580c34
fix: preview
grothem Mar 3, 2025
5318a6f
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Mar 4, 2025
b24d1c4
fix: reward prices
grothem Mar 4, 2025
c63d9b7
feat: merged with main
JoaquinBattilana Mar 24, 2025
a740a73
Feat/umbrella final (#2406)
JoaquinBattilana Apr 2, 2025
f024bfb
Merge branch 'main' into feat/umbrella
grothem Apr 2, 2025
f9e0a72
fix: package json
grothem Apr 2, 2025
9d217b5
fix: updated provider
grothem Apr 2, 2025
6bac5ee
fix: removed add to wallet action
grothem Apr 3, 2025
f4549d8
fix: search
grothem Apr 3, 2025
ade38f1
fix: gas estimation
grothem Apr 3, 2025
7624fdd
feat: claim all
grothem Apr 3, 2025
3ce12ff
Merge branch 'main' into feat/umbrella
grothem May 19, 2025
48ba808
chore: utils
grothem May 19, 2025
f375e0d
fix: addresse
grothem May 20, 2025
7302337
fix: misc fixes
grothem May 20, 2025
06e50f4
fix: apy
grothem May 20, 2025
13dba39
fix: reward
grothem May 20, 2025
432e194
chore: comment
grothem May 21, 2025
835bdd7
fix: apy calcs
grothem May 23, 2025
d49cc6c
Merge branch 'main' into feat/umbrella
grothem May 27, 2025
4fc0fd7
fix: package json
grothem May 27, 2025
b458d8f
fix: net apy
grothem May 28, 2025
34e612a
fix: apy tooltip
grothem May 28, 2025
87077c2
fix: preview deposit
grothem May 28, 2025
0ac160b
fix: unstake
grothem May 28, 2025
93b59b2
fix: alignment
grothem May 28, 2025
2171075
fix: unconnected state
grothem May 28, 2025
c5658db
fix: no cooldown
grothem May 29, 2025
8d3588c
fix: revert no cooldown
grothem May 29, 2025
9e404d9
chore: i18n
grothem May 29, 2025
ea86418
feat: sgho
grothem Jun 2, 2025
4f8ae31
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jun 2, 2025
dfa1e73
fix: typo
grothem Jun 2, 2025
92ed823
feat: sGHO
grothem Jun 3, 2025
644de3a
fix: copy
grothem Jun 3, 2025
139c29e
fix: stk gho
grothem Jun 3, 2025
ae0a800
fix: i18n
grothem Jun 3, 2025
633cef3
Merge branch 'main' into feat/umbrella
grothem Jun 3, 2025
5d29f11
fix: lint
grothem Jun 3, 2025
489a59d
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jun 3, 2025
8641b93
fix: safety module links
grothem Jun 3, 2025
e6f0bf7
feat: cooldown amount usd
grothem Jun 3, 2025
9362cd5
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jun 3, 2025
bc671d2
fix: routing
grothem Jun 3, 2025
0030621
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jun 3, 2025
550e3ac
chore: update text
foodaka Jun 3, 2025
6f257c9
fix: batchHelper key
foodaka Jun 3, 2025
e1ffe6c
chore: banner
foodaka Jun 3, 2025
645a1a2
chore: text
foodaka Jun 3, 2025
a9fb52f
feat: sgho banner
grothem Jun 4, 2025
047d7c0
chore: temp remove banner
grothem Jun 4, 2025
d8faa75
Merge branch 'main' into feat/umbrella
grothem Jun 4, 2025
26ff5bf
Merge branch 'feat/umbrella' of github.com:aave/interface into feat/u…
foodaka Jun 4, 2025
4300e17
fix: stake config map
foodaka Jun 4, 2025
ff77a3e
fix: allow fork config
foodaka Jun 4, 2025
912e9af
feat: nav items
foodaka Jun 4, 2025
01502a4
feat: safety module page updates
grothem Jun 4, 2025
8e49970
fix: mobile
grothem Jun 4, 2025
5916195
fix: copy
grothem Jun 4, 2025
37e73e5
chore: package bump
grothem Jun 4, 2025
4abf829
chore: i18n
grothem Jun 4, 2025
17406c5
test: stake
grothem Jun 4, 2025
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
16 changes: 0 additions & 16 deletions cypress/e2e/3-stake-governance/stake.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import {
} from '../../support/steps/stake.steps';

const testCases = [
{
asset: assets.staking.GHO,
amount: 5,
checkAmount: '5.00',
checkAmountFinal: '10.00',
tabValue: 'gho',
changeApproval: false,
},
{
asset: assets.staking.AAVE,
amount: 5,
Expand All @@ -26,14 +18,6 @@ const testCases = [
tabValue: 'aave',
changeApproval: true,
},
// {
// asset: assets.staking.ABPT,
// amount: 5,
// checkAmount: '5.00',
// checkAmountFinal: '10.00',
// tabValue: 'bpt',
// changeApproval: false,
// },
];

testCases.forEach(
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"test:coverage": "jest --coverage"
},
"dependencies": {
"@aave/contract-helpers": "1.33.3",
"@aave/math-utils": "1.33.3",
"@aave/contract-helpers": "1.34.0",
"@aave/math-utils": "1.34.0",
"@amplitude/analytics-browser": "^2.13.0",
"@bgd-labs/aave-address-book": "^4.22.1",
"@cowprotocol/app-data": "^3.1.0",
Expand Down
36 changes: 35 additions & 1 deletion pages/reserve-overview.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Trans } from '@lingui/macro';
import { Box, Typography } from '@mui/material';
import dynamic from 'next/dynamic';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import StyledToggleButton from 'src/components/StyledToggleButton';
Expand All @@ -17,6 +18,30 @@ import { useRootStore } from 'src/store/root';

import { ContentContainer } from '../src/components/ContentContainer';

const SavingsGhoDepositModal = dynamic(() =>
import('../src/components/transactions/SavingsGho/SavingsGhoDepositModal').then(
(module) => module.SavingsGhoDepositModal
)
);
const SavingsGhoWithdrawModal = dynamic(() =>
import('../src/components/transactions/SavingsGho/SavingsGhoWithdrawModal').then(
(module) => module.SavingsGhoWithdrawModal
)
);
const StakeModal = dynamic(() =>
import('../src/components/transactions/Stake/StakeModal').then((module) => module.StakeModal)
);
const StakeCooldownModal = dynamic(() =>
import('../src/components/transactions/StakeCooldown/StakeCooldownModal').then(
(module) => module.StakeCooldownModal
)
);
const UnStakeModal = dynamic(() =>
import('../src/components/transactions/UnStake/UnStakeModal').then(
(module) => module.UnStakeModal
)
);

export default function ReserveOverview() {
const router = useRouter();
const { reserves } = useAppDataContext();
Expand Down Expand Up @@ -104,5 +129,14 @@ export default function ReserveOverview() {
}

ReserveOverview.getLayout = function getLayout(page: React.ReactElement) {
return <MainLayout>{page}</MainLayout>;
return (
<MainLayout>
{page}
<StakeModal />
<StakeCooldownModal />
<UnStakeModal />
<SavingsGhoDepositModal />
<SavingsGhoWithdrawModal />
</MainLayout>
);
};
31 changes: 23 additions & 8 deletions pages/staking.staking.tsx → pages/safety-module.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useModalContext } from 'src/hooks/useModal';
import { MainLayout } from 'src/layouts/MainLayout';
import { GetABPToken } from 'src/modules/staking/GetABPToken';
import { GhoDiscountProgram } from 'src/modules/staking/GhoDiscountProgram';
import { GhoStakingPanel } from 'src/modules/staking/GhoStakingPanel';
import { StakingHeader } from 'src/modules/staking/StakingHeader';
import { StakingPanel } from 'src/modules/staking/StakingPanel';
import { useRootStore } from 'src/store/root';
Expand Down Expand Up @@ -49,6 +50,16 @@ const UnStakeModal = dynamic(() =>
(module) => module.UnStakeModal
)
);
const SavingsGhoDepositModal = dynamic(() =>
import('../src/components/transactions/SavingsGho/SavingsGhoDepositModal').then(
(module) => module.SavingsGhoDepositModal
)
);
const SavingsGhoWithdrawModal = dynamic(() =>
import('../src/components/transactions/SavingsGho/SavingsGhoWithdrawModal').then(
(module) => module.SavingsGhoWithdrawModal
)
);

export default function Staking() {
const { currentAccount } = useWeb3Context();
Expand Down Expand Up @@ -83,6 +94,8 @@ export default function Staking() {
openStakeRewardsClaim,
openStakeRewardsRestakeClaim,
openStakingMigrate,
openSavingsGhoDeposit,
openSavingsGhoWithdraw,
} = useModalContext();

const [mode, setMode] = useState<Stake>(Stake.aave);
Expand All @@ -97,7 +110,7 @@ export default function Staking() {

const tvl = {
'Staked Aave': Number(stkAave?.totalSupplyUSDFormatted || '0'),
'Staked GHO': Number(stkGho?.totalSupplyUSDFormatted || '0'),
// 'Staked GHO': Number(stkGho?.totalSupplyUSDFormatted || '0'),
'Staked ABPT': Number(stkBpt?.totalSupplyUSDFormatted || '0'),
'Staked ABPT V2': Number(stkBptV2?.totalSupplyUSDFormatted || '0'),
};
Expand Down Expand Up @@ -149,7 +162,7 @@ export default function Staking() {
</StyledToggleButton>
<StyledToggleButton value="gho" disabled={mode === 'gho'}>
<Typography variant="subheader1">
<Trans>Stake GHO</Trans>
<Trans>sGHO</Trans>
</Typography>
</StyledToggleButton>
<StyledToggleButton value="bpt" disabled={mode === 'bpt'}>
Expand Down Expand Up @@ -213,16 +226,16 @@ export default function Staking() {
lg={6}
sx={{ display: { xs: !isStkGho ? 'none' : 'block', lg: 'block' } }}
>
<StakingPanel
stakeTitle="GHO"
<GhoStakingPanel
stakeTitle="sGHO (formerly stkGHO)"
stakedToken="GHO"
icon="sgho"
maxSlash={stkGho?.maxSlashablePercentageFormatted || '0'}
icon="gho"
stakeData={stkGho}
stakeUserData={stkGhoUserData}
onStakeAction={() => openStake(Stake.gho, 'GHO')}
onCooldownAction={() => openStakeCooldown(Stake.gho, 'GHO')}
onUnstakeAction={() => openUnstake(Stake.gho, 'GHO')}
onStakeAction={() => openSavingsGhoDeposit()}
onCooldownAction={() => openSavingsGhoWithdraw()}
onUnstakeAction={() => openSavingsGhoWithdraw()}
onStakeRewardClaimAction={() => openStakeRewardsClaim(Stake.gho, 'AAVE')}
/>
</Grid>
Expand Down Expand Up @@ -344,6 +357,8 @@ Staking.getLayout = function getLayout(page: React.ReactElement) {
<UnStakeModal />
<StakeRewardClaimModal />
<StakeRewardClaimRestakeModal />
<SavingsGhoDepositModal />
<SavingsGhoWithdrawModal />
{/** End of modals */}
</MainLayout>
);
Expand Down
60 changes: 60 additions & 0 deletions pages/staking.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import dynamic from 'next/dynamic';
import { ContentContainer } from 'src/components/ContentContainer';
import { MainLayout } from 'src/layouts/MainLayout';
import { UmbrellaAssetsListContainer } from 'src/modules/umbrella/StakeAssets/UmbrellaAssetsListContainer';
import { UmrellaAssetsDefaultListContainer } from 'src/modules/umbrella/UmbrellaAssetsDefault';
import { UmbrellaHeader } from 'src/modules/umbrella/UmbrellaHeader';

import { useWeb3Context } from '../src/libs/hooks/useWeb3Context';

const UmbrellaStakeModal = dynamic(() =>
import('../src/modules/umbrella/UmbrellaModal').then((module) => module.UmbrellaModal)
);
const StakeCooldownModal = dynamic(() =>
import('../src/modules/umbrella/StakeCooldownModal').then((module) => module.StakeCooldownModal)
);
const StakeRewardClaimModal = dynamic(() =>
import('../src/components/transactions/StakeRewardClaim/StakeRewardClaimModal').then(
(module) => module.StakeRewardClaimModal
)
);
const StakeRewardClaimRestakeModal = dynamic(() =>
import(
'../src/components/transactions/StakeRewardClaimRestake/StakeRewardClaimRestakeModal'
).then((module) => module.StakeRewardClaimRestakeModal)
);
const UnStakeModal = dynamic(() =>
import('../src/modules/umbrella/UnstakeModal').then((module) => module.UnStakeModal)
);
const UmbrellaClaimModal = dynamic(() =>
import('../src/modules/umbrella/UmbrellaClaimModal').then((module) => module.UmbrellaClaimModal)
);

export default function UmbrellaStaking() {
const { currentAccount } = useWeb3Context();

return (
<>
<UmbrellaHeader />
<ContentContainer>
{currentAccount ? <UmbrellaAssetsListContainer /> : <UmrellaAssetsDefaultListContainer />}
</ContentContainer>
</>
);
}

UmbrellaStaking.getLayout = function getLayout(page: React.ReactElement) {
return (
<MainLayout>
{page}
{/** Modals */}
<UmbrellaStakeModal />
<StakeCooldownModal />
<UnStakeModal />
<StakeRewardClaimModal />
<StakeRewardClaimRestakeModal />
<UmbrellaClaimModal />
{/** End of modals */}
</MainLayout>
);
};
27 changes: 27 additions & 0 deletions public/icons/tokens/sgho.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/icons/tokens/stkgho.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions public/sgho-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/components/SecondsToString.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Trans } from '@lingui/macro';

function secondsToDHMS(seconds: number) {
const d = Math.floor(seconds / (3600 * 24));
const h = Math.floor((seconds % (3600 * 24)) / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = Math.floor(seconds % 60);
return { d, h, m, s };
}

export function SecondsToString({ seconds }: { seconds: number }) {
const { d, h, m, s } = secondsToDHMS(seconds);
return (
<>
{d !== 0 && (
<span>
<Trans>{d}d</Trans>
</span>
)}
{h !== 0 && (
<span>
<Trans>{h}h</Trans>
</span>
)}
{m !== 0 && (
<span>
<Trans>{m}m</Trans>
</span>
)}
{s !== 0 && (
<span>
<Trans>{s}s</Trans>
</span>
)}
</>
);
}
14 changes: 10 additions & 4 deletions src/components/Warnings/CooldownWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { GENERAL } from 'src/utils/events';

import { Link } from '../primitives/Link';
import { Warning } from '../primitives/Warning';
import { SecondsToString } from '../SecondsToString';

const TWENTY_DAYS = 20 * 24 * 60 * 60;

export const CooldownWarning = ({ cooldownSeconds }: { cooldownSeconds?: number }) => {
const cooldownTime = cooldownSeconds || TWENTY_DAYS;

export const CooldownWarning = () => {
const trackEvent = useRootStore((store) => store.trackEvent);
return (
<Warning severity="warning" sx={{ '.MuiAlert-message': { p: 0 }, mb: 6 }}>
Expand All @@ -15,9 +20,10 @@ export const CooldownWarning = () => {
</Typography>
<Typography variant="caption">
<Trans>
The cooldown period is the time required prior to unstaking your tokens (20 days). You can
only withdraw your assets from the Security Module after the cooldown period and within
the unstake window.
The cooldown period is the time required prior to unstaking your tokens (
<SecondsToString seconds={cooldownTime} />
). You can only withdraw your assets from the Security Module after the cooldown period
and within the unstake window.{' '}
<Link
href="https://docs.aave.com/faq/migration-and-staking"
fontWeight={500}
Expand Down
15 changes: 15 additions & 0 deletions src/components/infoTooltips/TokenContractTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ExternalLinkIcon } from '@heroicons/react/outline';
import { IconButton, SvgIcon } from '@mui/material';

import { Link } from '../primitives/Link';
import { DarkTooltip } from './DarkTooltip';

export const TokenContractTooltip = ({ explorerUrl }: { explorerUrl: string }) => (
<DarkTooltip title="View token contract" sx={{ display: { xsm: 'none' } }}>
<IconButton LinkComponent={Link} href={explorerUrl} sx={{ height: '24px', width: '24px' }}>
<SvgIcon sx={{ fontSize: '14px' }}>
<ExternalLinkIcon />
</SvgIcon>
</IconButton>
</DarkTooltip>
);
1 change: 1 addition & 0 deletions src/components/primitives/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ export const ROUTES = {
`/reserve-overview/?underlyingAsset=${underlyingAsset}&marketName=${marketName}`,
history: '/history',
bridge: '/bridge',
safetyModule: '/safety-module',
};
Loading
Loading