Skip to content

Commit

Permalink
chore: update stkgho message and add when wallet not connected (#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
foodaka authored Apr 29, 2024
1 parent aa8211f commit 52138ba
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2503,8 +2503,9 @@ msgid "The cooldown period is {0}. After {1} of cooldown, you will enter unstake
msgstr "The cooldown period is {0}. After {1} of cooldown, you will enter unstake window of {2}. You will continue receiving rewards during cooldown and unstake window."

#: src/modules/staking/StakingPanel.tsx
msgid "The current incentives period, decided on by the Aave community, has ended. Governance is in the process on renewing, check for updates. <0>Learn more</0>"
msgstr "The current incentives period, decided on by the Aave community, has ended. Governance is in the process on renewing, check for updates. <0>Learn more</0>"
#: src/modules/staking/StakingPanelNoWallet.tsx
msgid "The current incentives period, decided on by the Aave community, has ended. Governance is in the process on renewing, <0>see this proposal</0>."
msgstr "The current incentives period, decided on by the Aave community, has ended. Governance is in the process on renewing, <0>see this proposal</0>."

#: src/modules/migration/MigrationBottomPanel.tsx
msgid "The loan to value of the migrated positions would cause liquidation. Increase migrated collateral or reduce migrated borrow to continue."
Expand Down
7 changes: 4 additions & 3 deletions src/modules/staking/StakingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,16 @@ export const StakingPanel: React.FC<StakingPanelProps> = ({
<TextWithTooltip iconColor="warning.main">
<Trans>
The current incentives period, decided on by the Aave community, has ended.
Governance is in the process on renewing, check for updates.{' '}
Governance is in the process on renewing,{' '}
<Link
href="https://governance.aave.com"
href="https://app.aave.com/governance/v3/proposal/?proposalId=91"
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
>
Learn more
see this proposal
</Link>
.
</Trans>
</TextWithTooltip>
)}
Expand Down
31 changes: 28 additions & 3 deletions src/modules/staking/StakingPanelNoWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Trans } from '@lingui/macro';
import { Box, Typography } from '@mui/material';
import React from 'react';
import { FormattedNumber } from 'src/components/primitives/FormattedNumber';
import { Link } from 'src/components/primitives/Link';
import { TokenIcon } from 'src/components/primitives/TokenIcon';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { StakeTokenFormatted, useGeneralStakeUiData } from 'src/hooks/stake/useGeneralStakeUiData';
import { useRootStore } from 'src/store/root';

Expand Down Expand Up @@ -34,6 +36,9 @@ export const StakingPanelNoWallet: React.FC<StakingPanelNoWalletProps> = ({
if (stakedToken == 'ABPT') stakingAPY = stkBpt?.stakeApy || '0';
if (stakedToken == 'GHO') stakingAPY = stkGho?.stakeApy || '0';
if (stakedToken == 'ABPT V2') stakingAPY = stkBptV2?.stakeApy || '0';

const distributionEnded = Date.now() / 1000 > Number(stkGho?.distributionEnd);

return (
<Box
sx={(theme) => ({
Expand Down Expand Up @@ -80,9 +85,29 @@ export const StakingPanelNoWallet: React.FC<StakingPanelNoWalletProps> = ({
alignItems: 'center',
}}
>
<Typography variant="subheader2" color="text.secondary">
<Trans>Staking APR</Trans>
</Typography>
<Box display={'flex'} alignItems={'center'}>
<Typography variant="subheader2" color="text.secondary">
<Trans>Staking APR</Trans>
</Typography>

{distributionEnded && stakedToken === 'GHO' && (
<TextWithTooltip wrapperProps={{ marginBottom: '1px' }} iconColor="warning.main">
<Trans>
The current incentives period, decided on by the Aave community, has ended.
Governance is in the process on renewing,{' '}
<Link
href="https://app.aave.com/governance/v3/proposal/?proposalId=91"
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
>
see this proposal
</Link>
.
</Trans>
</TextWithTooltip>
)}
</Box>

<FormattedNumber
value={parseFloat(stakingAPY || '0') / 10000}
Expand Down

1 comment on commit 52138ba

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.