1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +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"
onClick={() => props.onToggleEnable()}
>
{t(
props.entry.options.enabled
? 'form-actions.disable'
: 'form-actions.enable',
)}
{props.entry.options.enabled
? t('form-actions.disable')
: t('form-actions.enable')}
</Button>
{props.enabled ? (
<>
@ -247,11 +245,9 @@ function ExtensionListItem(props: ExtensionListItemProps) {
size="small"
onClick={() => props.onToggleStatus()}
>
{t(
isRunning(props.status)
? 'form-actions.stop'
: 'form-actions.start',
)}
{isRunning(props.status)
? t('form-actions.stop')
: t('form-actions.start')}
</Button>
</>
) : null}

View file

@ -153,7 +153,9 @@ function RewardItem({
size="small"
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
styling="multi"
@ -231,7 +233,9 @@ function GoalItem({
size="small"
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
styling="multi"