Skip to content

Commit

Permalink
chore: fix total fee
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdef1cafe committed Oct 2, 2023
1 parent 9732f41 commit 1f1fb58
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/FeeExplainer/FeeExplainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,23 @@ type FeeOutputProps = {
}

export const FeeOutput: React.FC<FeeOutputProps> = ({ tradeSize, foxHolding }) => {
const { feeBps, feeUsd, feeUsdDiscount, foxDiscountPercent } = calculateFees({
const { feeBps, feeUsd, foxDiscountPercent } = calculateFees({
tradeAmountUsd: bn(tradeSize),
foxHeld: bn(foxHolding),
})
const totalFee = useMemo(() => feeUsd.minus(feeUsdDiscount), [feeUsd, feeUsdDiscount])
return (
<Stack>
<Flex gap={4}>
<Card flex={1}>
<CardBody>
{totalFee.lte(0) ? (
{feeUsd.lte(0) ? (
<RawText fontSize='3xl' color={'green.500'}>
Free
</RawText>
) : (
<Amount.Fiat
fontSize='3xl'
value={totalFee.lte(0) ? '0' : totalFee.toFixed(2)}
value={feeUsd.lte(0) ? '0' : feeUsd.toFixed(2)}
color={'green.500'}
/>
)}
Expand Down

0 comments on commit 1f1fb58

Please sign in to comment.