hide Quest Control when there are no Quests

This commit is contained in:
Anton 2023-12-22 08:45:35 +01:00
parent 979c4009f4
commit e0e154fcf6
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export function AppShell({ appName, children, assetsApi }) {
<BrowserRouter>
<AssetsProvider>
<SetAssetsApi assetsApi={assetsApi}></SetAssetsApi>
<QuestsProvider initialOpen={false}>
<QuestsProvider initialOpen={true}>
<ToastContainer position="top-right"
autoClose={2000}
hideProgressBar

View File

@ -1,6 +1,7 @@
import * as React from 'react'
import { useQuestsOpen, useSetQuestOpen } from './hooks/useQuests';
import { useAuth } from '../Auth';
import { useEffect } from 'react';
export function Quests() {
@ -8,6 +9,11 @@ export function Quests() {
const setQuestsOpen = useSetQuestOpen();
const { isAuthenticated, user } = useAuth();
useEffect(() => {
setQuestsOpen(false);
}, [])
return (
<>{questsOpen ?
<div className="tw-card tw-w-48 tw-bg-base-100 tw-shadow-xl tw-absolute tw-bottom-4 tw-left-4 tw-z-[2000]">