Skip to content

Commit

Permalink
Merge pull request #310 from mstable/feat/display-redeem-total-value
Browse files Browse the repository at this point in the history
feat(dHEDGE V1 Deprecation): display redeemed total value instead of …
  • Loading branch information
dimlbc authored Sep 26, 2024
2 parents a5ef57a + 3d3f925 commit 4f87429
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { TokenInput } from '@frontend/shared-ui';
import { Box, Button, Skeleton, Stack, Typography } from '@mui/material';
import {
Box,
type BoxProps,
Button,
Skeleton,
Stack,
Typography,
} from '@mui/material';
import { ArrowFatDown } from 'phosphor-react';
import { useAccount } from 'wagmi';

import { useSetL1TokenAmount } from '../../../hooks';
import { useTrackedState } from '../../../state';

import type { BoxProps } from '@mui/material';
import type { FC } from 'react';

export const TokenInputs = (props: BoxProps) => {
export const TokenInputs: FC<BoxProps> = (props) => {
const { isConnected } = useAccount();
const { l1token, l2token, isLoading, isError } = useTrackedState();
const setL1Amount = useSetL1TokenAmount();
Expand Down Expand Up @@ -67,8 +74,8 @@ export const TokenInputs = (props: BoxProps) => {
Intl.NumberFormat('en-US', {
currency: 'USD',
style: 'currency',
maximumSignificantDigits: 2,
}).format(l1token.price)
maximumFractionDigits: 2,
}).format(l1token.price * l1token.amount.simple)
)}
</Typography>
{isConnected &&
Expand Down Expand Up @@ -139,7 +146,8 @@ export const TokenInputs = (props: BoxProps) => {
Intl.NumberFormat('en-US', {
currency: 'USD',
style: 'currency',
}).format(l2token.price)
maximumFractionDigits: 2,
}).format(l2token.price * l2token.amount.simple)
)}
</Typography>
{isConnected && (
Expand Down

0 comments on commit 4f87429

Please sign in to comment.