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