mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
Add prettier for codestyle and re-format everything (#1294)
This commit is contained in:
parent
8b78154075
commit
0aae1f70d2
319 changed files with 4809 additions and 3936 deletions
|
@ -25,24 +25,21 @@ export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props })
|
|||
|
||||
const loginLink = useMemo(() => {
|
||||
const activeProviders = Object.entries(authProviders)
|
||||
.filter((entry: [string, boolean]) => entry[1])
|
||||
.map(entry => entry[0])
|
||||
const activeOneClickProviders = activeProviders.filter(entry => !INTERACTIVE_LOGIN_METHODS.includes(entry))
|
||||
.filter((entry: [string, boolean]) => entry[1])
|
||||
.map((entry) => entry[0])
|
||||
const activeOneClickProviders = activeProviders.filter((entry) => !INTERACTIVE_LOGIN_METHODS.includes(entry))
|
||||
|
||||
if (activeProviders.length === 1 && activeOneClickProviders.length === 1) {
|
||||
return `${ getApiUrl() }auth/${ activeOneClickProviders[0] }`
|
||||
return `${getApiUrl()}auth/${activeOneClickProviders[0]}`
|
||||
}
|
||||
return '/login'
|
||||
}, [authProviders])
|
||||
|
||||
return (
|
||||
<ShowIf condition={ authEnabled }>
|
||||
<LinkContainer to={ loginLink } title={ t('login.signIn') }>
|
||||
<Button
|
||||
data-cy={ 'sign-in-button' }
|
||||
variant={ variant || 'success' }
|
||||
{ ...props }>
|
||||
<Trans i18nKey="login.signIn"/>
|
||||
<ShowIf condition={authEnabled}>
|
||||
<LinkContainer to={loginLink} title={t('login.signIn')}>
|
||||
<Button data-cy={'sign-in-button'} variant={variant || 'success'} {...props}>
|
||||
<Trans i18nKey='login.signIn' />
|
||||
</Button>
|
||||
</LinkContainer>
|
||||
</ShowIf>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue