Skip to content

Commit

Permalink
Redeem for usd comes first
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Jan 24, 2025
1 parent ee32f3c commit 9813d6c
Showing 1 changed file with 48 additions and 49 deletions.
97 changes: 48 additions & 49 deletions web/components/cashout/select-cashout-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,54 @@ function CashoutOptionsContent(props: {
const hasNoRedeemableCash = redeemableCash === 0
return (
<Col className={clsx('gap-4', allDisabled && 'text-ink-700 opacity-80')}>
<Card className="pb-1">
<DollarDescription disabled={allDisabled} />
<Col className="gap-0.5">
<Button
className={clsx('text-xs sm:text-sm')}
onClick={() => {
setPage(redeemForUSDPageName)
}}
disabled={
!!allDisabled || noHasMinRedeemableCash || !TWOMBA_CASHOUT_ENABLED
}
>
Redeem for USD
</Button>
{!TWOMBA_CASHOUT_ENABLED && (
<div className="text-ink-500 text-xs sm:text-sm">
Cashouts should be enabled in less than a week
</div>
)}
<Row className="text-ink-500 w-full justify-between gap-1 whitespace-nowrap text-xs sm:text-sm ">
<span>
{noHasMinRedeemableCash && !allDisabled ? (
<span className="text-red-600 dark:text-red-400">
You need at least{' '}
<TokenNumber
amount={MIN_CASHOUT_AMOUNT}
isInline
coinType="sweepies"
className="font-semibold text-amber-600 dark:text-amber-400"
/>{' '}
to redeem
</span>
) : null}
</span>
<span>
<span
className={clsx(
'font-semibold',
allDisabled ? '' : 'text-green-600 dark:text-green-500'
)}
>
${((1 - CHARITY_FEE) * redeemableCash).toFixed(2)}
</span>{' '}
value
</span>
</Row>
</Col>
</Card>
<Card className="pb-1">
<ManaDescription disabled={allDisabled} />
<Col className="gap-0.5">
Expand Down Expand Up @@ -236,55 +284,6 @@ function CashoutOptionsContent(props: {
</Col>
</Card>
)}

<Card className="pb-1">
<DollarDescription disabled={allDisabled} />
<Col className="gap-0.5">
<Button
className={clsx('text-xs sm:text-sm')}
onClick={() => {
setPage(redeemForUSDPageName)
}}
disabled={
!!allDisabled || noHasMinRedeemableCash || !TWOMBA_CASHOUT_ENABLED
}
>
Redeem for USD
</Button>
{!TWOMBA_CASHOUT_ENABLED && (
<div className="text-ink-500 text-xs sm:text-sm">
Cashouts should be enabled in less than a week
</div>
)}
<Row className="text-ink-500 w-full justify-between gap-1 whitespace-nowrap text-xs sm:text-sm ">
<span>
{noHasMinRedeemableCash && !allDisabled ? (
<span className="text-red-600 dark:text-red-400">
You need at least{' '}
<TokenNumber
amount={MIN_CASHOUT_AMOUNT}
isInline
coinType="sweepies"
className="font-semibold text-amber-600 dark:text-amber-400"
/>{' '}
to redeem
</span>
) : null}
</span>
<span>
<span
className={clsx(
'font-semibold',
allDisabled ? '' : 'text-green-600 dark:text-green-500'
)}
>
${((1 - CHARITY_FEE) * redeemableCash).toFixed(2)}
</span>{' '}
value
</span>
</Row>
</Col>
</Card>
</Col>
)
}
Expand Down

0 comments on commit 9813d6c

Please sign in to comment.