mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 15:51:13 -05:00
Fix: Header Admin link loading state
This commit is contained in:
@@ -28,7 +28,7 @@ export function Header() {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [mobileSearchOpen, setMobileSearchOpen] = useState(false);
|
const [mobileSearchOpen, setMobileSearchOpen] = useState(false);
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const { isModerator } = useUserRole();
|
const { isModerator, loading: rolesLoading } = useUserRole();
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -94,7 +94,7 @@ export function Header() {
|
|||||||
>
|
>
|
||||||
Property Owners
|
Property Owners
|
||||||
</Link>
|
</Link>
|
||||||
{isModerator() && (
|
{!rolesLoading && isModerator() && (
|
||||||
<>
|
<>
|
||||||
<div className="my-2 border-t border-border" />
|
<div className="my-2 border-t border-border" />
|
||||||
<Link
|
<Link
|
||||||
@@ -214,7 +214,7 @@ export function Header() {
|
|||||||
</NavigationMenuList>
|
</NavigationMenuList>
|
||||||
</NavigationMenu>
|
</NavigationMenu>
|
||||||
|
|
||||||
{isModerator() && (
|
{!rolesLoading && isModerator() && (
|
||||||
<Button variant="ghost" size="sm" className="h-9" asChild>
|
<Button variant="ghost" size="sm" className="h-9" asChild>
|
||||||
<Link to="/admin">Admin</Link>
|
<Link to="/admin">Admin</Link>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user