diff --git a/web/components/manaboard.tsx b/web/components/manaboard.tsx index 7d10fd53..f17a712b 100644 --- a/web/components/manaboard.tsx +++ b/web/components/manaboard.tsx @@ -10,6 +10,8 @@ import { Transaction, writeTransaction, } from '../lib/firebase/transactions' +import { loadFakeBalance } from '../pages/leaderboards' +import { AddFundsButton } from './add-funds-button' import { AmountInput } from './amount-input' import { Avatar } from './avatar' import { Col } from './layout/col' @@ -150,6 +152,10 @@ export function BuySlotModal(props: { } } + const fakeBalance = loadFakeBalance() + const noFundsMsg = + value > fakeBalance ? `You only have ${formatMoney(fakeBalance)}!` : '' + return ( <> @@ -183,12 +189,23 @@ export function BuySlotModal(props: { label={ENV_CONFIG.moneyMoniker} /> - -
- Additional fees: {formatMoney(newValue * 0.25)} per hour -
+ {noFundsMsg ? ( +
+ {noFundsMsg}{' '} + + + +
+ ) : ( + + +
+ Additional fees: {formatMoney(newValue * 0.25)} per hour +
+ + )}