Skip to content

Commit

Permalink
show usd for inscribe transfer.
Browse files Browse the repository at this point in the history
  • Loading branch information
abangZ committed Jul 19, 2024
1 parent 337f5db commit 1590e91
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ui/pages/Approval/components/InscribeTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import {
} from '@/ui/state/transactions/hooks';
import { fontSizes } from '@/ui/theme/font';
import { spacing } from '@/ui/theme/spacing';
import { satoshisToAmount, useApproval, useLocationState, useWallet } from '@/ui/utils';
import { amountToSatoshis, satoshisToAmount, useApproval, useLocationState, useWallet } from '@/ui/utils';
import { getAddressUtxoDust } from '@unisat/wallet-sdk/lib/transaction';

import { useNavigate } from '../../MainRoute';
import SignPsbt from './SignPsbt';
import { TickUsdWithoutPrice } from '@/ui/components/TickUsd';
import { BtcUsd } from '@/ui/components/BtcUsd';

interface Props {
params: {
Expand Down Expand Up @@ -281,9 +283,9 @@ function InscribeTransferStep({ contextData, updateContextData }: StepProps) {
<Text text="Inscribe TRANSFER" preset="title-bold" textCenter my="lg" />

<Column>
<Row justifyBetween>
<Row justifyBetween itemsCenter>
<Text text="Available" color="textDim" />

<TickUsdWithoutPrice tick={contextData.ticker} balance={inputAmount} type={'brc20'}/>
{tokenBalance ? (
<Column>
{tokenBalance.availableBalanceUnSafe != '0' ? (
Expand Down Expand Up @@ -439,7 +441,9 @@ function InscribeConfirmStep({ contextData, updateContextData }: StepProps) {
<Text text={`${amount}`} preset="title-bold" size="xxl" textCenter wrap digital/>
<BRC20Ticker tick={tokenBalance.ticker} preset="lg" />
</Row>

<Row itemsCenter justifyCenter>
<TickUsdWithoutPrice tick={tokenBalance.ticker} balance={amount+''} type={'brc20'}/>
</Row>
<Column mt="xxl">
<Text text="Preview" preset="sub-bold" />
<Card preset="style2">
Expand Down Expand Up @@ -487,6 +491,10 @@ function InscribeConfirmStep({ contextData, updateContextData }: StepProps) {
<Text text="Total" color="gold" />
<Text text={`${totalFee} BTC`} color="gold" />
</Row>
<Row justifyBetween>
<div></div>
<BtcUsd sats={amountToSatoshis(totalFee)}/>
</Row>
</Column>
</Column>
</Column>
Expand Down

0 comments on commit 1590e91

Please sign in to comment.