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