Skip to content

Commit e45fcca

Browse files
committed
Hide "Security" entirely if its useless
…instead of leaving it visible but disabled
1 parent f0dad9e commit e45fcca

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

jsapp/js/components/account/accountSidebar.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,19 @@ export default class AccountSidebar extends React.Component<
8383
</bem.FormSidebar__label>
8484
}
8585

86-
<bem.FormSidebar__label
87-
m={{selected: this.isSecuritySelected()}}
88-
href={'#' + ROUTES.SECURITY}
89-
disabled={ !(envStore.isReady && envStore.data.mfa_enabled) }
90-
>
91-
<Icon name='lock-alt' size='xl'/>
92-
<bem.FormSidebar__labelText>
93-
{t('Security')}
94-
</bem.FormSidebar__labelText>
95-
</bem.FormSidebar__label>
86+
{ /* hide "Security" entirely if nothing there is available */
87+
envStore.isReady && envStore.data.mfa_enabled &&
88+
<bem.FormSidebar__label
89+
m={{selected: this.isSecuritySelected()}}
90+
href={'#' + ROUTES.SECURITY}
91+
disabled={ !(envStore.isReady && envStore.data.mfa_enabled) }
92+
>
93+
<Icon name='lock-alt' size='xl'/>
94+
<bem.FormSidebar__labelText>
95+
{t('Security')}
96+
</bem.FormSidebar__labelText>
97+
</bem.FormSidebar__label>
98+
}
9699
</bem.FormSidebar>
97100
);
98101
}

0 commit comments

Comments
 (0)