diff --git a/package.json b/package.json index 1312add..5ed5067 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.6.16", + "version": "0.6.17", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Bond/components/ClaimBonds.jsx b/src/containers/Bond/components/ClaimBonds.jsx index 3590649..d290dd3 100644 --- a/src/containers/Bond/components/ClaimBonds.jsx +++ b/src/containers/Bond/components/ClaimBonds.jsx @@ -20,6 +20,7 @@ import { formatCurrency } from "../../../helpers"; import { useCurrentIndex, useEpoch, useWarmupLength, useWarmupInfo } from "../../../hooks/staking"; import { useNotes, redeem } from "../../../hooks/bonds"; import { useTokenSymbol } from "../../../hooks/tokens"; +import { useGhstPrice } from "../../../hooks/prices"; export const ClaimBonds = ({ chainId, address, secondsTo }) => { const isSmallScreen = useScreenSize("md"); @@ -28,6 +29,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { const [isPreClaimConfirmed, setPreClaimConfirmed] = useState(false); const [isPayoutGhst, _] = useState(true); + const ghstPrice = useGhstPrice(chainId); const { epoch } = useEpoch(chainId); const { warmupExists } = useWarmupLength(chainId); const { warmupInfo } = useWarmupInfo(chainId, BOND_DEPOSITORY_ADDRESSES[chainId]); @@ -97,6 +99,8 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { ? formatCurrency(totalClaimableBalance, 5, ghstSymbol) : formatCurrency(currentIndex.mul(totalClaimableBalance), 5, stnkSymbol) } +   + ({formatCurrency(totalClaimableBalance * ghstPrice, 2)}) @@ -139,12 +143,15 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { Payout - - {isPayoutGhst - ? formatCurrency(note.payout, 5, ghstSymbol) - : formatCurrency(currentIndex.mul(note.payout), 5, stnkSymbol) - } - + + + {isPayoutGhst + ? formatCurrency(note.payout, 5, ghstSymbol) + : formatCurrency(currentIndex.mul(note.payout), 5, stnkSymbol) + } + + {formatCurrency(note.payout * ghstPrice, 2)} + @@ -195,12 +202,15 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { - - {isPayoutGhst - ? formatCurrency(note.payout, 5, ghstSymbol) - : formatCurrency(currentIndex.mul(note.payout), 5, stnkSymbol) - } - + + + {isPayoutGhst + ? formatCurrency(note.payout, 5, ghstSymbol) + : formatCurrency(currentIndex.mul(note.payout), 5, stnkSymbol) + } + + {formatCurrency(note.payout * ghstPrice, 2)} + diff --git a/src/containers/Stake/components/ClaimsArea.jsx b/src/containers/Stake/components/ClaimsArea.jsx index de39ece..b30fad6 100644 --- a/src/containers/Stake/components/ClaimsArea.jsx +++ b/src/containers/Stake/components/ClaimsArea.jsx @@ -24,10 +24,11 @@ import { PrimaryButton, SecondaryButton } from "../../../components/Button"; import { DecimalBigNumber } from "../../../helpers/DecimalBigNumber"; import { prettifySecondsInDays } from "../../../helpers/timeUtil"; -import { formatNumber } from "../../../helpers"; +import { formatNumber, formatCurrency } from "../../../helpers"; import { STAKING_ADDRESSES } from "../../../constants/addresses"; import { useCurrentIndex, useWarmupInfo } from "../../../hooks/staking"; import { useBalanceForShares, useTokenSymbol } from "../../../hooks/tokens"; +import { useGhstPrice } from "../../../hooks/prices"; import ClaimConfirmationModal from "./ClaimConfirmationModal"; @@ -53,6 +54,7 @@ export const ClaimsArea = ({ chainId, address, epoch }) => { const [confirmationModalOpen, setConfirmationModalOpen] = useState(false); const [isPayoutGhst, _] = useState(true); + const ghstPrice = useGhstPrice(chainId); const { warmupInfo: claim, refetch: claimRefetch } = useWarmupInfo(chainId, address); const { currentIndex, refetch: currentIndexRefetch } = useCurrentIndex(chainId); const { balanceForShares } = useBalanceForShares(chainId, "STNK", claim.shares); @@ -132,6 +134,7 @@ export const ClaimsArea = ({ chainId, address, epoch }) => { isClaimable={claim.expiry > epoch.number} stnkSymbol={stnkSymbol} ghstSymbol={ghstSymbol} + ghstPrice={ghstPrice} /> @@ -141,7 +144,17 @@ export const ClaimsArea = ({ chainId, address, epoch }) => { ); }; -const ClaimInfo = ({ setConfirmationModalOpen, prepareBalance, claim, epoch, isClaimable, isPayoutGhst, stnkSymbol, ghstSymbol }) => { +const ClaimInfo = ({ + setConfirmationModalOpen, + prepareBalance, + claim, + epoch, + isClaimable, + isPayoutGhst, + stnkSymbol, + ghstSymbol, + ghstPrice +}) => { return ( @@ -155,7 +168,10 @@ const ClaimInfo = ({ setConfirmationModalOpen, prepareBalance, claim, epoch, isC - {`${formatNumber(prepareBalance, 5)} ${isPayoutGhst ? ghstSymbol : stnkSymbol}`} + {formatCurrency(prepareBalance, 5, isPayoutGhst ? ghstSymbol : stnkSymbol)} + + + {formatCurrency(prepareBalance * ghstPrice, 2)}