mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 00:24:43 -04:00
Restructure repository (#426)
organized repository Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Philip Molares <git@molar.es>
This commit is contained in:
parent
66258ca615
commit
0fadc09f2b
254 changed files with 384 additions and 403 deletions
29
src/components/landing-layout/navigation/sign-in-button.tsx
Normal file
29
src/components/landing-layout/navigation/sign-in-button.tsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
import { ButtonProps } from 'react-bootstrap/Button'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { LinkContainer } from 'react-router-bootstrap'
|
||||
import { ApplicationState } from '../../../redux'
|
||||
import { ShowIf } from '../../common/show-if/show-if'
|
||||
|
||||
type SignInButtonProps = {
|
||||
className?: string
|
||||
} & Omit<ButtonProps, 'href'>
|
||||
|
||||
export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props }) => {
|
||||
const { t } = useTranslation()
|
||||
const authProviders = useSelector((state: ApplicationState) => state.config.authProviders)
|
||||
return (
|
||||
<ShowIf condition={Object.values(authProviders).includes(true)}>
|
||||
<LinkContainer to="/login" title={t('login.signIn')}>
|
||||
<Button
|
||||
variant={variant || 'success'}
|
||||
{...props}
|
||||
>
|
||||
<Trans i18nKey="login.signIn"/>
|
||||
</Button>
|
||||
</LinkContainer>
|
||||
</ShowIf>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue