mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
hide Quest Control when there are no Quests
This commit is contained in:
parent
979c4009f4
commit
e0e154fcf6
@ -14,7 +14,7 @@ export function AppShell({ appName, children, assetsApi }) {
|
|||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<AssetsProvider>
|
<AssetsProvider>
|
||||||
<SetAssetsApi assetsApi={assetsApi}></SetAssetsApi>
|
<SetAssetsApi assetsApi={assetsApi}></SetAssetsApi>
|
||||||
<QuestsProvider initialOpen={false}>
|
<QuestsProvider initialOpen={true}>
|
||||||
<ToastContainer position="top-right"
|
<ToastContainer position="top-right"
|
||||||
autoClose={2000}
|
autoClose={2000}
|
||||||
hideProgressBar
|
hideProgressBar
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useQuestsOpen, useSetQuestOpen } from './hooks/useQuests';
|
import { useQuestsOpen, useSetQuestOpen } from './hooks/useQuests';
|
||||||
import { useAuth } from '../Auth';
|
import { useAuth } from '../Auth';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
export function Quests() {
|
export function Quests() {
|
||||||
|
|
||||||
@ -8,6 +9,11 @@ export function Quests() {
|
|||||||
const setQuestsOpen = useSetQuestOpen();
|
const setQuestsOpen = useSetQuestOpen();
|
||||||
const { isAuthenticated, user } = useAuth();
|
const { isAuthenticated, user } = useAuth();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setQuestsOpen(false);
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>{questsOpen ?
|
<>{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]">
|
<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?.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>
|
<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>
|
</ul>
|
||||||
{ /** <button className='tw-btn tw-btn-xs tw-btn-neutral tw-w-fit tw-self-center tw-mt-1'>Next ></button> */
|
{ /** <button className='tw-btn tw-btn-xs tw-btn-neutral tw-w-fit tw-self-center tw-mt-1'>Next ></button> */
|
||||||
} </div>
|
} </div>
|
||||||
</div>
|
</div>
|
||||||
: ""
|
: ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user