Skip to content

Commit

Permalink
feat: oeth withdrawal
Browse files Browse the repository at this point in the history
- full precision for 'receive amount' and fix mobile sizing bug
  • Loading branch information
apexearth committed Aug 12, 2024
1 parent 701531f commit 00d2275
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions libs/defi/oeth/src/redeem/components/Swapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ import {
useSwapState,
useWatchBalance,
} from '@origin/shared/providers';
import {
formatError,
getFormatPrecision,
isNilOrEmpty,
} from '@origin/shared/utils';
import { formatError, isNilOrEmpty } from '@origin/shared/utils';
import { format, from, mul } from 'dnum';
import { useIntl } from 'react-intl';
import { useAccount } from 'wagmi';
Expand Down Expand Up @@ -344,7 +340,7 @@ function SwapperWrapped({
amountIn === 0n;

return (
<Card>
<Card sx={{ maxWidth: '100%' }}>
<CardHeader title={intl.formatMessage({ defaultMessage: 'Redeem' })} />
<Divider />
<CardContent sx={{ display: 'flex', flexDirection: 'column', pb: 0 }}>
Expand Down Expand Up @@ -399,18 +395,15 @@ function SwapperWrapped({
borderColor: 'divider',
}}
>
<Stack spacing={1.5}>
<Stack spacing={1.5} overflow={'hidden'}>
<LoadingLabel
isLoading={isSwapRoutesLoading}
sWidth={60}
variant="h6"
color={amountIn === 0n ? 'text.secondary' : 'text.primary'}
>
{format([amountOut ?? 0n, tokenOut?.decimals ?? 18], {
digits: getFormatPrecision([
amountOut ?? 0n,
tokenOut?.decimals ?? 18,
]),
digits: 18,
decimalsRounding: 'ROUND_DOWN',
})}
</LoadingLabel>
Expand Down

0 comments on commit 00d2275

Please sign in to comment.