diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index 3940fe9..4b22e51 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -20,7 +20,7 @@ import {
import { cn } from "@/lib/utils";
import { useAppSelector } from "@/hooks/redux-hooks";
-import { useTenantTheme } from "@/hooks/useTenantTheme";
+import { useAppTheme } from "@/hooks/useAppTheme";
import { AuthenticatedImage } from "@/components/shared";
interface MenuItem {
@@ -109,6 +109,11 @@ const tenantAdminPlatformServiceMenu: MenuItem[] = [
path: "/tenant/files",
requiredPermission: { resource: "files" },
},
+ {
+ label: "Storage Dashboard",
+ path: "/tenant/files/storage-dashboard",
+ requiredPermission: { resource: "files" },
+ },
],
requiredPermission: { resource: "files" },
},
@@ -185,15 +190,15 @@ const GroupMenuItem = ({
item,
childrenItems,
location,
- isSuperAdmin,
- theme,
+ primaryColor,
+ secondaryColor,
onClose,
}: {
item: MenuItem;
childrenItems: any[];
location: any;
- isSuperAdmin: boolean;
- theme: any;
+ primaryColor: string;
+ secondaryColor: string;
onClose: () => void;
}) => {
const isChildActive = (path: string) => {
@@ -205,6 +210,14 @@ const GroupMenuItem = ({
);
if (isSubActionActive) return false;
}
+
+ // Special handling for Files List to NOT show as active when Storage Dashboard is active
+ if (path === "/tenant/files") {
+ if (location.pathname.startsWith("/tenant/files/storage-dashboard")) {
+ return false;
+ }
+ }
+
return (
location.pathname === path || location.pathname.startsWith(`${path}/`)
);
@@ -233,14 +246,8 @@ const GroupMenuItem = ({
style={
isAnyChildActive
? {
- backgroundColor:
- !isSuperAdmin && theme?.primary_color
- ? theme.primary_color
- : "#112868",
- color:
- !isSuperAdmin && theme?.secondary_color
- ? theme.secondary_color
- : "#23dce1",
+ backgroundColor: primaryColor,
+ color: secondaryColor,
}
: undefined
}
@@ -283,10 +290,7 @@ const GroupMenuItem = ({
style={
isActive
? {
- color:
- !isSuperAdmin && theme?.primary_color
- ? theme.primary_color
- : "#112868",
+ color: primaryColor,
}
: undefined
}
@@ -304,9 +308,9 @@ const GroupMenuItem = ({
};
export const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
+ const { primaryColor, secondaryColor, accentColor, logoUrl } = useAppTheme();
const location = useLocation();
const { roles, permissions } = useAppSelector((state) => state.auth);
- const { theme, logoUrl } = useAppSelector((state) => state.theme);
// Fetch theme for tenant admin
const isSuperAdminCheck = () => {
@@ -357,9 +361,9 @@ export const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
const roleName = getRoleName();
// Fetch theme if tenant admin
- if (!isSuperAdmin) {
- useTenantTheme();
- }
+ // if (!isSuperAdmin) {
+ // useTenantTheme();
+ // }
// Helper function to check if user has permission for a resource
const hasPermission = (
@@ -461,8 +465,8 @@ export const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
item={item}
childrenItems={children}
location={location}
- isSuperAdmin={isSuperAdmin}
- theme={theme}
+ primaryColor={primaryColor}
+ secondaryColor={secondaryColor}
onClose={onClose}
/>
);
@@ -494,14 +498,8 @@ export const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
style={
isActive
? {
- backgroundColor:
- !isSuperAdmin && theme?.primary_color
- ? theme.primary_color
- : "#112868",
- color:
- !isSuperAdmin && theme?.secondary_color
- ? theme.secondary_color
- : "#23dce1",
+ backgroundColor: primaryColor,
+ color: secondaryColor,
}
: undefined
}
@@ -545,10 +543,7 @@ export const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
className="w-9 h-9 rounded-[10px] flex items-center justify-center shadow-[0px_4px_12px_0px_rgba(15,23,42,0.1)] shrink-0"
style={{
display: !isSuperAdmin && logoUrl ? "none" : "flex",
- backgroundColor:
- !isSuperAdmin && theme?.primary_color
- ? theme.primary_color
- : "#112868",
+ backgroundColor: primaryColor,
}}
>
Attach files via File Attachment Service
-Attach Files
- {files.length === 0 ? ( -Click to upload or drag and drop
-- Attach supporting source files via File Attachment Service -
-PDF, DOCX, XLSX up to {MAX_SIZE_MB}MB
-Attach Files
+ {files.length === 0 ? ( +Click to upload or drag and drop
++ Attach supporting source files via File Attachment Service +
+PDF, DOCX, XLSX up to {MAX_SIZE_MB}MB
+Up to {MAX_FILES} files allowed
- - {uploadSuccess && ( -Up to {MAX_FILES} files allowed
- {/* Description */} -Select New File
++ {selectedFile.name} +
++ {(selectedFile.size / 1024 / 1024).toFixed(2)} MB +
+ +Click to upload or drag and drop
++ Supported: PDF, DOCX, XLSX, Images, etc. +
+