fix(frontend-config): use guest access level instead of allowAnonymous

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-09-24 22:56:31 +02:00
parent 56643ffd85
commit 1207ce7690
4 changed files with 17 additions and 9 deletions

View file

@ -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
}