mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-02 07:59:56 -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
|
@ -21,59 +21,59 @@ export const ViaInternal: React.FC = () => {
|
|||
const [error, setError] = useState(false)
|
||||
const allowRegister = useSelector((state: ApplicationState) => state.config.allowRegister)
|
||||
|
||||
const onLoginSubmit = useCallback((event: FormEvent) => {
|
||||
doInternalLogin(username, password)
|
||||
.then(() => fetchAndSetUser())
|
||||
.catch(() => setError(true))
|
||||
event.preventDefault()
|
||||
}, [username, password])
|
||||
const onLoginSubmit = useCallback(
|
||||
(event: FormEvent) => {
|
||||
doInternalLogin(username, password)
|
||||
.then(() => fetchAndSetUser())
|
||||
.catch(() => setError(true))
|
||||
event.preventDefault()
|
||||
},
|
||||
[username, password]
|
||||
)
|
||||
|
||||
return (
|
||||
<Card className="bg-dark mb-4">
|
||||
<Card className='bg-dark mb-4'>
|
||||
<Card.Body>
|
||||
<Card.Title>
|
||||
<Trans i18nKey="login.signInVia" values={ { service: t('login.auth.username') } }/>
|
||||
<Trans i18nKey='login.signInVia' values={{ service: t('login.auth.username') }} />
|
||||
</Card.Title>
|
||||
<Form onSubmit={ onLoginSubmit }>
|
||||
<Form.Group controlId="internal-username">
|
||||
<Form onSubmit={onLoginSubmit}>
|
||||
<Form.Group controlId='internal-username'>
|
||||
<Form.Control
|
||||
isInvalid={ error }
|
||||
type="text"
|
||||
size="sm"
|
||||
placeholder={ t('login.auth.username') }
|
||||
onChange={ (event) => setUsername(event.currentTarget.value) } className="bg-dark text-light"
|
||||
autoComplete='username'/>
|
||||
isInvalid={error}
|
||||
type='text'
|
||||
size='sm'
|
||||
placeholder={t('login.auth.username')}
|
||||
onChange={(event) => setUsername(event.currentTarget.value)}
|
||||
className='bg-dark text-light'
|
||||
autoComplete='username'
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group controlId="internal-password">
|
||||
<Form.Group controlId='internal-password'>
|
||||
<Form.Control
|
||||
isInvalid={ error }
|
||||
type="password"
|
||||
size="sm"
|
||||
placeholder={ t('login.auth.password') }
|
||||
onChange={ (event) => setPassword(event.currentTarget.value) }
|
||||
className="bg-dark text-light"
|
||||
autoComplete='current-password'/>
|
||||
isInvalid={error}
|
||||
type='password'
|
||||
size='sm'
|
||||
placeholder={t('login.auth.password')}
|
||||
onChange={(event) => setPassword(event.currentTarget.value)}
|
||||
className='bg-dark text-light'
|
||||
autoComplete='current-password'
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Alert className="small" show={ error } variant="danger">
|
||||
<Trans i18nKey="login.auth.error.usernamePassword"/>
|
||||
<Alert className='small' show={error} variant='danger'>
|
||||
<Trans i18nKey='login.auth.error.usernamePassword' />
|
||||
</Alert>
|
||||
|
||||
<div className='flex flex-row' dir='auto'>
|
||||
<Button
|
||||
type="submit"
|
||||
variant="primary"
|
||||
className='mx-2'>
|
||||
<Trans i18nKey="login.signIn"/>
|
||||
<Button type='submit' variant='primary' className='mx-2'>
|
||||
<Trans i18nKey='login.signIn' />
|
||||
</Button>
|
||||
<ShowIf condition={ allowRegister }>
|
||||
<Link to={ '/register' }>
|
||||
<Button
|
||||
type='button'
|
||||
variant='secondary'
|
||||
className='mx-2'>
|
||||
<Trans i18nKey='login.register.title'/>
|
||||
<ShowIf condition={allowRegister}>
|
||||
<Link to={'/register'}>
|
||||
<Button type='button' variant='secondary' className='mx-2'>
|
||||
<Trans i18nKey='login.register.title' />
|
||||
</Button>
|
||||
</Link>
|
||||
</ShowIf>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue