admin button added
This commit is contained in:
parent
8d007a7393
commit
8a45f49a04
@ -1,14 +1,13 @@
|
||||
"use client";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { Dispatch, SetStateAction, useMemo, useState } from "react";
|
||||
import { FaRegUserCircle } from "react-icons/fa";
|
||||
|
||||
import { Currency } from "@appTypes/StoreModel";
|
||||
import AuthModal from "@components/AuthModal";
|
||||
import { useStoreActions, useStoreState } from "@hooks/store";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function Navbar({}: // currencySelector,
|
||||
{
|
||||
@ -18,7 +17,7 @@ export default function Navbar({}: // currencySelector,
|
||||
const user = useStoreState((state) => state.user);
|
||||
const selectedCurrency = useStoreState((state) => state.currency.selectedCurrency);
|
||||
const setSelectedCurrency = useStoreActions((actions) => actions.currency.setSelectedCurrency);
|
||||
const navOptions = useMemo(() => ["Earthquakes", "Observatories", "Shop","Administrator"], []);
|
||||
const navOptions = useMemo(() => ["Earthquakes", "Observatories", "Shop"], []);
|
||||
// const navOptions = useMemo(() => ["Earthquakes"], []);
|
||||
const aboutDropdown = ["Contact Us", "Our Mission", "The Team"];
|
||||
// { label: "Our Mission", path: "/our-mission" },
|
||||
@ -136,6 +135,11 @@ export default function Navbar({}: // currencySelector,
|
||||
<ManagementNavbarButton name="Warehouse" href="/warehouse"></ManagementNavbarButton>
|
||||
</div>
|
||||
)}
|
||||
{user && user.role === "ADMIN" && (
|
||||
<div className="flex h-full mr-5">
|
||||
<ManagementNavbarButton name="Admin" href="/administrator"></ManagementNavbarButton>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button className="my-auto mr-4" onClick={() => (user ? router.push("/profile") : setIsModalOpen(true))}>
|
||||
<FaRegUserCircle size={22} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user