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]">
@ -27,7 +33,7 @@ export function Quests() {
<li><label className="tw-label tw-justify-normal tw-pt-1 tw-pb-0"><input type="checkbox" readOnly={true} className="tw-checkbox tw-checkbox-xs tw-checkbox-success" checked={user?.description ? true : false} /><span className='tw-text-sm tw-label-text tw-mx-2'>Fill Profile</span></label></li>
<li><label className="tw-label tw-justify-normal tw-pt-1 tw-pb-0"><input type="checkbox" readOnly={true} className="tw-checkbox tw-checkbox-xs tw-checkbox-success" checked={user?.avatar ? true : false} /><span className='tw-text-sm tw-label-text tw-mx-2'>Upload Avatar</span></label></li>
</ul>
{ /** <button className='tw-btn tw-btn-xs tw-btn-neutral tw-w-fit tw-self-center tw-mt-1'>Next &gt;</button> */
{ /** <button className='tw-btn tw-btn-xs tw-btn-neutral tw-w-fit tw-self-center tw-mt-1'>Next &gt;</button> */
} </div>
</div>
: ""