refactor: require label on buy/confirm buttons

This commit is contained in:
Sinclair Chen 2022-10-04 17:48:24 -07:00
parent 7a271fce29
commit 9f256aa7a8

View File

@ -18,7 +18,7 @@ export function WarningConfirmationButton(props: {
openModalButtonClass?: string openModalButtonClass?: string
color: ColorType color: ColorType
size: SizeType size: SizeType
actionLabel?: string actionLabel: string
}) { }) {
const { const {
amount, amount,
@ -32,12 +32,11 @@ export function WarningConfirmationButton(props: {
actionLabel, actionLabel,
} = props } = props
const label = capitalize(actionLabel) ?? 'Wager'
const buttonText = isSubmitting const buttonText = isSubmitting
? 'Submitting...' ? 'Submitting...'
: amount : amount
? `${label} ${formatMoney(amount)}` ? `${actionLabel} ${formatMoney(amount)}`
: label : actionLabel
if (!warning) { if (!warning) {
return ( return (