mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 17:41:52 -04:00
fix(frontend-config): use guest access level instead of allowAnonymous
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
56643ffd85
commit
1207ce7690
4 changed files with 17 additions and 9 deletions
|
@ -10,16 +10,17 @@ import { NewNoteButton } from '../../common/new-note-button/new-note-button'
|
|||
import { HistoryButton } from '../../layout/app-bar/app-bar-elements/help-dropdown/history-button'
|
||||
import { useFrontendConfig } from '../../common/frontend-config-context/use-frontend-config'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { GuestAccessLevel } from '../../../api/config/types'
|
||||
|
||||
/**
|
||||
* Renders the card with the options for not logged-in users.
|
||||
*/
|
||||
export const GuestCard: React.FC = () => {
|
||||
const allowAnonymous = useFrontendConfig().allowAnonymous
|
||||
const guestAccessLevel = useFrontendConfig().guestAccess
|
||||
|
||||
useTranslation()
|
||||
|
||||
if (!allowAnonymous) {
|
||||
if (guestAccessLevel === GuestAccessLevel.DENY) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue