Ask user to buy more mana when insufficient funds (#124)

This commit is contained in:
Sinclair Chen 2022-05-03 13:36:54 -07:00 committed by GitHub
parent f2217d1d8b
commit 100821e34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import { Bet } from '../../common/bet'
import { Spacer } from './layout/spacer' import { Spacer } from './layout/spacer'
import { calculateCpmmSale } from '../../common/calculate-cpmm' import { calculateCpmmSale } from '../../common/calculate-cpmm'
import { Binary, CPMM, FullContract } from '../../common/contract' import { Binary, CPMM, FullContract } from '../../common/contract'
import { SiteLink } from './site-link'
export function AmountInput(props: { export function AmountInput(props: {
amount: number | undefined amount: number | undefined
@ -65,7 +66,16 @@ export function AmountInput(props: {
{error && ( {error && (
<div className="mb-2 mr-auto self-center whitespace-nowrap text-xs font-medium tracking-wide text-red-500"> <div className="mb-2 mr-auto self-center whitespace-nowrap text-xs font-medium tracking-wide text-red-500">
{error} {error === 'Insufficient balance' ? (
<>
Not enough funds.
<span className="ml-1 text-indigo-500">
<SiteLink href="/add-funds">Buy more?</SiteLink>
</span>
</>
) : (
error
)}
</div> </div>
)} )}