mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
isAdmin comeback
This commit is contained in:
parent
7810101256
commit
2fa2d6de60
@ -12,8 +12,7 @@ import { HistoryItem } from './HistoryItem';
|
||||
import { binDates } from './date-binning';
|
||||
import { useSearchFilter } from '~/lib/hooks/useSearchFilter';
|
||||
import { SaveProblem } from './SaveProblem';
|
||||
import { authStatusStore } from '~/lib/stores/auth';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { useAdminStatus } from '~/lib/stores/user';
|
||||
|
||||
const menuVariants = {
|
||||
closed: {
|
||||
@ -46,7 +45,7 @@ export const Menu = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [dialogContent, setDialogContent] = useState<DialogContent>(null);
|
||||
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
||||
const isLoggedIn = useStore(authStatusStore.isLoggedIn);
|
||||
const { isAdmin } = useAdminStatus();
|
||||
|
||||
const { filteredItems: filteredList, handleSearchChange } = useSearchFilter({
|
||||
items: list,
|
||||
@ -140,7 +139,7 @@ export const Menu = () => {
|
||||
>
|
||||
Problems
|
||||
</a>
|
||||
{isLoggedIn && <SaveProblem />}
|
||||
{isAdmin && <SaveProblem />}
|
||||
<a
|
||||
href="/about"
|
||||
className="flex gap-2 bg-bolt-elements-sidebar-buttonBackgroundDefault text-bolt-elements-sidebar-buttonText hover:bg-bolt-elements-sidebar-buttonBackgroundHover rounded-md p-2 transition-theme"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user