diff --git a/webui/public/file.svg b/webui/public/file.svg
deleted file mode 100644
index 004145c..0000000
--- a/webui/public/file.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/webui/public/globe.svg b/webui/public/globe.svg
deleted file mode 100644
index 567f17b..0000000
--- a/webui/public/globe.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/webui/public/logo.png b/webui/public/logo.png
new file mode 100644
index 0000000..b0ae2d4
Binary files /dev/null and b/webui/public/logo.png differ
diff --git a/webui/public/next.svg b/webui/public/next.svg
deleted file mode 100644
index 5174b28..0000000
--- a/webui/public/next.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/webui/public/vercel.svg b/webui/public/vercel.svg
deleted file mode 100644
index 7705396..0000000
--- a/webui/public/vercel.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/webui/public/window.svg b/webui/public/window.svg
deleted file mode 100644
index b2b2a44..0000000
--- a/webui/public/window.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/webui/src/app/components/ImprinkAppBar.js b/webui/src/app/components/ImprinkAppBar.js
index 5ab6649..d635d44 100644
--- a/webui/src/app/components/ImprinkAppBar.js
+++ b/webui/src/app/components/ImprinkAppBar.js
@@ -15,7 +15,7 @@ import {
useTheme,
Paper
} from "@mui/material";
-import { useState, useEffect } from "react";
+import { useState } from "react";
import { useUser } from "@auth0/nextjs-auth0";
import {
Menu as MenuIcon,
@@ -29,43 +29,16 @@ import {
BugReport
} from "@mui/icons-material";
import ThemeToggleButton from "@/app/components/theme/ThemeToggleButton";
-import clientApi from "@/lib/clientApi";
+import useRoles from "@/app/components/hooks/useRoles";
export default function ImprinkAppBar() {
const { user, error, isLoading } = useUser();
+ const { isMerchant, isAdmin } = useRoles();
const [anchorEl, setAnchorEl] = useState(null);
- const [userRoles, setUserRoles] = useState([]);
- const [rolesLoading, setRolesLoading] = useState(false);
const theme = useTheme();
const { isDarkMode, toggleTheme } = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
- useEffect(() => {
- const fetchUserRoles = async () => {
- if (!user) {
- setUserRoles([]);
- return;
- }
-
- setRolesLoading(true);
- try {
- const response = await clientApi.get('/users/me/roles');
- const roles = response.data.map(role => role.roleName.toLowerCase());
- setUserRoles(roles);
- } catch (error) {
- console.error('Failed to fetch user roles:', error);
- setUserRoles([]);
- } finally {
- setRolesLoading(false);
- }
- };
-
- fetchUserRoles();
- }, [user]);
-
- const isMerchant = userRoles.includes('merchant') || userRoles.includes('admin');
- const isAdmin = userRoles.includes('admin');
-
const handleMenuOpen = (event) => {
setAnchorEl(event.currentTarget);
};
@@ -74,7 +47,6 @@ export default function ImprinkAppBar() {
setAnchorEl(null);
};
- // Regular navigation links (excluding admin-specific ones)
const navigationLinks = [
{ label: 'Home', href: '/', icon: , show: true },
{ label: 'Gallery', href: '/gallery', icon: , show: true },
@@ -82,7 +54,6 @@ export default function ImprinkAppBar() {
{ label: 'Merchant', href: '/merchant', icon: , show: isMerchant },
];
- // Admin-specific links for the separate bar
const adminLinks = [
{ label: 'Dashboard', href: '/dashboard', icon: , show: isMerchant },
{ label: 'Admin', href: '/admin', icon: , show: isAdmin },
@@ -206,7 +177,6 @@ export default function ImprinkAppBar() {
>
- {/* All navigation links - regular and admin mixed together */}
{[...visibleLinks, ...visibleAdminLinks].map((link) => (