implemented
This commit is contained in:
parent
a31bd8246c
commit
d3638e2e69
18 changed files with 1643 additions and 120 deletions
|
|
@ -3,6 +3,9 @@
|
|||
import { useRouter } from "next/navigation";
|
||||
import { useAuth } from "../auth-context";
|
||||
import { sharedStyles } from "../styles/shared";
|
||||
import constants from "../../../shared/constants.json";
|
||||
|
||||
const { ADMIN, REGULAR } = constants.roles;
|
||||
|
||||
type PageId = "counter" | "sum" | "profile" | "invites" | "audit" | "admin-invites";
|
||||
|
||||
|
|
@ -33,8 +36,8 @@ const ADMIN_NAV_ITEMS: NavItem[] = [
|
|||
export function Header({ currentPage }: HeaderProps) {
|
||||
const { user, logout, hasRole } = useAuth();
|
||||
const router = useRouter();
|
||||
const isRegularUser = hasRole("regular");
|
||||
const isAdminUser = hasRole("admin");
|
||||
const isRegularUser = hasRole(REGULAR);
|
||||
const isAdminUser = hasRole(ADMIN);
|
||||
|
||||
const handleLogout = async () => {
|
||||
await logout();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue