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:
parent
f92a4035e8
commit
745824a32d
2 changed files with 12 additions and 12 deletions
|
@ -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}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue