mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 10:45:20 -04:00
Add application state hook (#1308)
* Add application state hook Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Add docs Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4720f2d36b
commit
829cc2fe48
47 changed files with 149 additions and 195 deletions
|
@ -7,17 +7,16 @@
|
|||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { ApplicationState } from '../../../redux'
|
||||
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
||||
import { ShowIf } from '../../common/show-if/show-if'
|
||||
import { SignInButton } from '../../landing-layout/navigation/sign-in-button'
|
||||
import './cover-buttons.scss'
|
||||
|
||||
export const CoverButtons: React.FC = () => {
|
||||
useTranslation()
|
||||
const userExists = useSelector((state: ApplicationState) => !!state.user)
|
||||
const anyAuthProviderActivated = useSelector((state: ApplicationState) =>
|
||||
const userExists = useApplicationState((state) => !!state.user)
|
||||
const anyAuthProviderActivated = useApplicationState((state) =>
|
||||
Object.values(state.config.authProviders).includes(true)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue