1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-20 02:00:49 +00:00

refactor: slightly better ternaries

This commit is contained in:
Ash Keel 2023-04-08 19:32:11 +02:00
parent f92a4035e8
commit 745824a32d
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E
2 changed files with 12 additions and 12 deletions

View file

@ -234,11 +234,9 @@ function ExtensionListItem(props: ExtensionListItemProps) {
size="small" size="small"
onClick={() => props.onToggleEnable()} onClick={() => props.onToggleEnable()}
> >
{t( {props.entry.options.enabled
props.entry.options.enabled ? t('form-actions.disable')
? 'form-actions.disable' : t('form-actions.enable')}
: 'form-actions.enable',
)}
</Button> </Button>
{props.enabled ? ( {props.enabled ? (
<> <>
@ -247,11 +245,9 @@ function ExtensionListItem(props: ExtensionListItemProps) {
size="small" size="small"
onClick={() => props.onToggleStatus()} onClick={() => props.onToggleStatus()}
> >
{t( {isRunning(props.status)
isRunning(props.status) ? t('form-actions.stop')
? 'form-actions.stop' : t('form-actions.start')}
: 'form-actions.start',
)}
</Button> </Button>
</> </>
) : null} ) : null}

View file

@ -153,7 +153,9 @@ function RewardItem({
size="small" size="small"
onClick={() => (onToggle ? onToggle() : null)} onClick={() => (onToggle ? onToggle() : null)}
> >
{t(item.enabled ? 'form-actions.disable' : 'form-actions.enable')} {item.enabled
? t('form-actions.disable')
: t('form-actions.enable')}
</Button> </Button>
<Button <Button
styling="multi" styling="multi"
@ -231,7 +233,9 @@ function GoalItem({
size="small" size="small"
onClick={() => (onToggle ? onToggle() : null)} onClick={() => (onToggle ? onToggle() : null)}
> >
{t(item.enabled ? 'form-actions.disable' : 'form-actions.enable')} {item.enabled
? t('form-actions.disable')
: t('form-actions.enable')}
</Button> </Button>
<Button <Button
styling="multi" styling="multi"