Skip to content

Commit fd3baf8

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/update-tooltip-celo
2 parents 3762a66 + aa30a40 commit fd3baf8

14 files changed

+167
-32
lines changed

src/locales/el/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.po

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ msgstr "Estimated time"
7070
msgid "Remind me"
7171
msgstr "Remind me"
7272

73+
#: src/modules/umbrella/helpers/StakedUnderlyingTooltip.tsx
74+
msgid "Total amount of underlying assets staked. This number represents the combined sum of your original asset and the corresponding aTokens staked in Umbrella."
75+
msgstr "Total amount of underlying assets staked. This number represents the combined sum of your original asset and the corresponding aTokens staked in Umbrella."
76+
7377
#: src/modules/umbrella/helpers/ApyTooltip.tsx
7478
msgid "Reward APY adjusts with total staked amount, following a curve that targets optimal staking levels."
7579
msgstr "Reward APY adjusts with total staked amount, following a curve that targets optimal staking levels."
@@ -196,7 +200,7 @@ msgstr "Please connect a wallet to view your personal information here."
196200
msgid "USDT on Ethereum requires approval reset before a new approval. This will require an additional transaction."
197201
msgstr "USDT on Ethereum requires approval reset before a new approval. This will require an additional transaction."
198202

199-
#: src/modules/umbrella/AmountStakedItem.tsx
203+
#: src/modules/umbrella/AmountSharesItem.tsx
200204
msgid "After the cooldown period ends, you will enter the unstake window of {0}. You will continue receiving rewards during cooldown and the unstake period."
201205
msgstr "After the cooldown period ends, you will enter the unstake window of {0}. You will continue receiving rewards during cooldown and the unstake period."
202206

@@ -364,6 +368,7 @@ msgstr "Maximum available to borrow"
364368
msgid "Sign to continue"
365369
msgstr "Sign to continue"
366370

371+
#: src/modules/umbrella/UmbrellaHeader.tsx
367372
#: src/modules/umbrella/UmbrellaHeader.tsx
368373
msgid "Total amount staked"
369374
msgstr "Total amount staked"
@@ -462,10 +467,6 @@ msgstr "Signing"
462467
msgid "Repay {symbol}"
463468
msgstr "Repay {symbol}"
464469

465-
#: src/modules/umbrella/StakeAssets/UmbrellaAssetsListMobileItem.tsx
466-
msgid "Your staked amount"
467-
msgstr "Your staked amount"
468-
469470
#: src/modules/sGho/SavingsGhoCard.tsx
470471
#: src/modules/sGho/SGhoDepositPanel.tsx
471472
#: src/modules/staking/GhoStakingPanel.tsx
@@ -569,7 +570,7 @@ msgstr "Claim all"
569570
#: src/modules/sGho/SGhoDepositPanel.tsx
570571
#: src/modules/staking/GhoStakingPanel.tsx
571572
#: src/modules/staking/StakingPanel.tsx
572-
#: src/modules/umbrella/AmountStakedItem.tsx
573+
#: src/modules/umbrella/AmountSharesItem.tsx
573574
msgid "Time remaining until the withdraw period ends."
574575
msgstr "Time remaining until the withdraw period ends."
575576

@@ -762,6 +763,10 @@ msgstr "Protocol borrow cap at 100% for this asset. Further borrowing unavailabl
762763
msgid "Stable"
763764
msgstr "Stable"
764765

766+
#: src/modules/umbrella/helpers/SharesTooltip.tsx
767+
msgid "Shares"
768+
msgstr "Shares"
769+
765770
#: src/components/transactions/DebtSwitch/DebtSwitchModalContent.tsx
766771
msgid "Variable rate"
767772
msgstr "Variable rate"
@@ -1748,10 +1753,14 @@ msgstr "Show Frozen or paused assets"
17481753
#: src/modules/sGho/SGhoDepositPanel.tsx
17491754
#: src/modules/staking/GhoStakingPanel.tsx
17501755
#: src/modules/staking/StakingPanel.tsx
1751-
#: src/modules/umbrella/AmountStakedItem.tsx
1756+
#: src/modules/umbrella/AmountSharesItem.tsx
17521757
msgid "Amount in cooldown"
17531758
msgstr "Amount in cooldown"
17541759

1760+
#: src/modules/umbrella/helpers/SharesTooltip.tsx
1761+
msgid "Shares are Umbrella Stake Tokens you receive when staking. They represent your ownership in the pool, and the amount of underlying you can redeem depends on the current exchange rate between shares and the underlying."
1762+
msgstr "Shares are Umbrella Stake Tokens you receive when staking. They represent your ownership in the pool, and the amount of underlying you can redeem depends on the current exchange rate between shares and the underlying."
1763+
17551764
#: src/modules/governance/proposal/VotersListContainer.tsx
17561765
msgid "Failed to load proposal voters. Please refresh the page."
17571766
msgstr "Failed to load proposal voters. Please refresh the page."
@@ -2029,6 +2038,10 @@ msgstr "Amount to Bridge"
20292038
msgid "Please always be aware of your <0>Health Factor (HF)</0> when partially migrating a position and that your rates will be updated to V3 rates."
20302039
msgstr "Please always be aware of your <0>Health Factor (HF)</0> when partially migrating a position and that your rates will be updated to V3 rates."
20312040

2041+
#: src/modules/umbrella/helpers/StakedUnderlyingTooltip.tsx
2042+
msgid "Staked Underlying"
2043+
msgstr "Staked Underlying"
2044+
20322045
#: src/layouts/components/StakingMenu.tsx
20332046
#: src/layouts/components/StakingMenu.tsx
20342047
msgid "Umbrella"
@@ -2185,7 +2198,7 @@ msgstr "This asset is eligible for rewards through SuperFest. Aave Labs does not
21852198
msgid "Cooldown period warning"
21862199
msgstr "Cooldown period warning"
21872200

2188-
#: src/modules/umbrella/AmountStakedItem.tsx
2201+
#: src/modules/umbrella/AmountSharesItem.tsx
21892202
msgid "Available to withdraw"
21902203
msgstr "Available to withdraw"
21912204

@@ -2460,10 +2473,6 @@ msgstr "Borrowed"
24602473
msgid "Received"
24612474
msgstr "Received"
24622475

2463-
#: src/modules/umbrella/StakeAssets/UmbrellaAssetsList.tsx
2464-
msgid "Your Staked Amount"
2465-
msgstr "Your Staked Amount"
2466-
24672476
#: src/modules/dashboard/LiquidationRiskParametresModal/LiquidationRiskParametresModal.tsx
24682477
msgid "Your current loan to value based on your collateral supplied."
24692478
msgstr "Your current loan to value based on your collateral supplied."

src/locales/es/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/fr/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/umbrella/AmountStakedItem.tsx renamed to src/modules/umbrella/AmountSharesItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useCurrentTimestamp } from 'src/hooks/useCurrentTimestamp';
1313

1414
import { ListValueColumn } from '../dashboard/lists/ListValueColumn';
1515

16-
export const AmountStakedItem = ({ stakeData }: { stakeData: MergedStakeData }) => {
16+
export const AmountSharesItem = ({ stakeData }: { stakeData: MergedStakeData }) => {
1717
const now = useCurrentTimestamp(1);
1818
const { stakeTokenBalance, stakeTokenBalanceUSD } = stakeData.formattedBalances;
1919

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Stack } from '@mui/material';
2+
import { formatUnits } from 'ethers/lib/utils';
3+
import { FormattedNumber } from 'src/components/primitives/FormattedNumber';
4+
import { MergedStakeData } from 'src/hooks/stake/useUmbrellaSummary';
5+
import { useRootStore } from 'src/store/root';
6+
7+
import { usePreviewRedeem } from './hooks/usePreviewRedeem';
8+
9+
export const AmountStakedUnderlyingItem = ({
10+
stakeData,
11+
isMobile,
12+
}: {
13+
stakeData: MergedStakeData;
14+
isMobile?: boolean;
15+
}) => {
16+
const currentMarketData = useRootStore((s) => s.currentMarketData);
17+
const chainId = currentMarketData?.chainId;
18+
19+
const { stakeTokenRedeemableAmount } = stakeData.balances;
20+
const { underlyingTokenAddress, underlyingTokenDecimals, underlyingIsStataToken, decimals } =
21+
stakeData;
22+
23+
const isGhoToken = !underlyingIsStataToken;
24+
25+
const { data: sharesEquivalentAssets = '0' } = usePreviewRedeem(
26+
stakeTokenRedeemableAmount,
27+
underlyingTokenDecimals,
28+
underlyingTokenAddress,
29+
chainId,
30+
!isGhoToken
31+
);
32+
const formattedGhoAmount = formatUnits(stakeTokenRedeemableAmount, decimals);
33+
const assetUnderlyingAmount = isGhoToken ? formattedGhoAmount : sharesEquivalentAssets;
34+
35+
return (
36+
<Stack
37+
direction={isMobile ? 'row' : 'column'}
38+
alignItems="center"
39+
justifyContent="center"
40+
gap={2}
41+
>
42+
<FormattedNumber compact value={assetUnderlyingAmount} variant="secondary14" />
43+
</Stack>
44+
);
45+
};

src/modules/umbrella/StakeAssets/UmbrellaAssetsList.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { ListHeaderWrapper } from 'src/components/lists/ListHeaderWrapper';
77
import { MergedStakeData } from 'src/hooks/stake/useUmbrellaSummary';
88

99
import { ApyTooltip } from '../helpers/ApyTooltip';
10+
import { SharesTooltip } from '../helpers/SharesTooltip';
11+
import { StakedUnderlyingTooltip } from '../helpers/StakedUnderlyingTooltip';
1012
import { UmbrellaAssetsListItemLoader } from './UmbrellaAssetsListItemLoader';
1113
import { UmbrellaAssetsListMobileItem } from './UmbrellaAssetsListMobileItem';
1214
import { UmbrellaAssetsListMobileItemLoader } from './UmbrellaAssetsListMobileItemLoader';
@@ -22,8 +24,12 @@ const listHeaders = [
2224
sortKey: 'totalAPY',
2325
},
2426
{
25-
title: <Trans>Your Staked Amount</Trans>,
26-
sortKey: 'stakeTokenBalance',
27+
title: <StakedUnderlyingTooltip />,
28+
sortKey: 'stakeTokenUnderlyingBalance',
29+
},
30+
{
31+
title: <SharesTooltip />,
32+
sortKey: 'stakeSharesTokens',
2733
},
2834
{
2935
title: <Trans>Available to Stake</Trans>,
@@ -80,8 +86,16 @@ export default function UmbrellaAssetsList({
8086
const balanceB = Number(b.formattedBalances.totalAvailableToStake);
8187
return sortDesc ? balanceB - balanceA : balanceA - balanceB;
8288
}
83-
84-
if (sortName === 'stakeTokenBalance') {
89+
//! Your Staked Amount: shows the underlying of assets(ej. USDC, WETH) staked or equivalent to the
90+
//! shares.
91+
//! Using stakeTokenReedemableAmount should be the equivalent in Asset to the shares
92+
if (sortName === 'stakeTokenUnderlyingBalance') {
93+
const balanceA = Number(a.formattedBalances?.stakeTokenRedeemableAmount || '0');
94+
const balanceB = Number(b.formattedBalances?.stakeTokenRedeemableAmount || '0');
95+
return sortDesc ? balanceB - balanceA : balanceA - balanceB;
96+
}
97+
//!trial: Shares shows the staked StkToken obtained from the staked asset amount
98+
if (sortName === 'stakeSharesTokens') {
8599
const balanceA = Number(a.formattedBalances?.stakeTokenBalance || '0');
86100
const balanceB = Number(b.formattedBalances?.stakeTokenBalance || '0');
87101
return sortDesc ? balanceB - balanceA : balanceA - balanceB;

src/modules/umbrella/StakeAssets/UmbrellaAssetsListMobileItem.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ import { useShallow } from 'zustand/shallow';
88

99
import { Row } from '../../../components/primitives/Row';
1010
import { ListMobileItemWrapper } from '../../dashboard/lists/ListMobileItemWrapper';
11-
import { AmountStakedItem } from '../AmountStakedItem';
11+
import { AmountSharesItem } from '../AmountSharesItem';
12+
import { AmountStakedUnderlyingItem } from '../AmountStakedUnderlyingItem';
1213
import { AvailableToClaimItem } from '../AvailableToClaimItem';
1314
import { AvailableToStakeItem } from '../AvailableToStakeItem';
1415
import { ApyTooltip } from '../helpers/ApyTooltip';
16+
import { SharesTooltip } from '../helpers/SharesTooltip';
17+
import { StakedUnderlyingTooltip } from '../helpers/StakedUnderlyingTooltip';
1518
import { StakingApyItem } from '../StakingApyItem';
1619
import { StakeAssetName } from './StakeAssetName';
1720

@@ -44,13 +47,17 @@ export const UmbrellaAssetsListMobileItem = ({ ...umbrellaStakeAsset }: MergedSt
4447
</Box>
4548
</Row>
4649
<Row
47-
caption={<Trans>Your staked amount</Trans>}
50+
caption={<StakedUnderlyingTooltip />}
4851
captionVariant="description"
4952
mb={3}
5053
align="flex-start"
5154
>
52-
<AmountStakedItem stakeData={umbrellaStakeAsset} />
55+
<AmountStakedUnderlyingItem stakeData={umbrellaStakeAsset} isMobile />
5356
</Row>
57+
<Row caption={<SharesTooltip />} captionVariant="description" mb={3} align="flex-start">
58+
<AmountSharesItem stakeData={umbrellaStakeAsset} />
59+
</Row>
60+
5461
<Row
5562
caption={<Trans>Available to stake</Trans>}
5663
captionVariant="description"

src/modules/umbrella/StakeAssets/UmbrellaStakeAssetsListItem.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { useShallow } from 'zustand/shallow';
55

66
import { ListColumn } from '../../../components/lists/ListColumn';
77
import { ListItem } from '../../../components/lists/ListItem';
8-
import { AmountStakedItem } from '../AmountStakedItem';
8+
import { AmountSharesItem } from '../AmountSharesItem';
9+
import { AmountStakedUnderlyingItem } from '../AmountStakedUnderlyingItem';
910
import { AvailableToClaimItem } from '../AvailableToClaimItem';
1011
import { AvailableToStakeItem } from '../AvailableToStakeItem';
1112
import { StakingApyItem } from '../StakingApyItem';
@@ -32,7 +33,12 @@ export const UmbrellaStakeAssetsListItem = ({ ...umbrellaStakeAsset }: MergedSta
3233
</ListColumn>
3334

3435
<ListColumn>
35-
<AmountStakedItem stakeData={umbrellaStakeAsset} />
36+
<AmountStakedUnderlyingItem stakeData={umbrellaStakeAsset} />
37+
</ListColumn>
38+
39+
{/* Shares */}
40+
<ListColumn>
41+
<AmountSharesItem stakeData={umbrellaStakeAsset} />
3642
</ListColumn>
3743

3844
<ListColumn>

0 commit comments

Comments
 (0)