Skip to content

Commit

Permalink
chore: refactor text
Browse files Browse the repository at this point in the history
  • Loading branch information
lissavxo committed Nov 26, 2024
1 parent 65c43b2 commit dc657bf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions react/lib/components/Widget/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -630,15 +630,13 @@ export const Widget: React.FunctionComponent<WidgetProps> = props => {
textAlign="center"
>
<Typography className={errorMsg ? classes.error : classes.text}>
{errorMsg
? errorMsg
: disabled
? 'Not yet ready for payment'
: loading
? 'Loading...'
: success
? successText
: text}
{(() => {
if (errorMsg) return errorMsg;
if (disabled) return 'Not yet ready for payment';
if (loading) return 'Loading...';
if (success) return successText;
return text;
})()}
</Typography>
</Box>
<Box
Expand Down

0 comments on commit dc657bf

Please sign in to comment.