refactor: require label on buy/confirm buttons
This commit is contained in:
parent
7a271fce29
commit
9f256aa7a8
|
@ -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 (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user