Skip to content

Commit

Permalink
Passing shares balance to liquid popover
Browse files Browse the repository at this point in the history
  • Loading branch information
ioay committed Apr 4, 2024
1 parent 597b0f8 commit d71a13b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dapp/src/components/LiquidStakingTokenPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IconButton,
} from "@chakra-ui/react"
import { SizeType } from "#/types"
import { useDocsDrawer, useWalletContext } from "#/hooks"
import { useDocsDrawer, useSharesBalance, useWalletContext } from "#/hooks"
import { TextMd, TextSm } from "./shared/Typography"
import Alert from "./shared/Alert"
import { CurrencyBalance } from "./shared/CurrencyBalance"
Expand All @@ -23,6 +23,7 @@ export function LiquidStakingTokenPopover({
}: LiquidStakingTokenPopoverProps) {
const { isConnected } = useWalletContext()
const { onOpen: openDocsDrawer } = useDocsDrawer()
const sharesBalance = useSharesBalance()

return (
<Popover variant="no-transform" {...props}>
Expand Down Expand Up @@ -50,7 +51,7 @@ export function LiquidStakingTokenPopover({
<PopoverBody p={0}>
<TextMd fontWeight="bold">Liquid staking token</TextMd>
<CurrencyBalance
amount="912312331"
amount={sharesBalance.toString()}
variant="greater-balance-xl"
currency="stbtc"
/>
Expand Down
1 change: 1 addition & 0 deletions dapp/src/hooks/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./useAppDispatch"
export * from "./useAppSelector"
export * from "./useEstimatedBTCBalance"
export * from "./useSharesBalance"
6 changes: 6 additions & 0 deletions dapp/src/hooks/store/useSharesBalance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { selectSharesBalance } from "#/store/btc"
import { useAppSelector } from "./useAppSelector"

export function useSharesBalance() {
return useAppSelector(selectSharesBalance)
}

0 comments on commit d71a13b

Please sign in to comment.