fix sidebar
All checks were successful
Build and Deploy Next.js + Nginx Docker Image / build-and-deploy (push) Successful in 49s
Build and Deploy Next.js + Nginx Docker Image / deploy (push) Successful in 7s

This commit is contained in:
Mohamadzadeh 2026-08-19 19:49:03 +03:30
parent 0ddd3427ae
commit 685774b577
2 changed files with 21 additions and 33 deletions

38
dist/layout.js vendored

File diff suppressed because one or more lines are too long

View File

@ -69,8 +69,9 @@ const DesktopNavItem = ({
onNavigate,
}) => {
const commonProps = {
variant: isActive ? "solid" : "ghost",
colorScheme: isActive ? "gray" : undefined,
variant: "ghost",
bg: isActive ? "gray.200" : "transparent",
mx: isActive ? 2 : 0,
icon: <Icon as={item.icon} />,
fontSize: "xl",
size: { base: "sm", lg: "lg" },
@ -94,11 +95,7 @@ const DesktopNavItem = ({
: { as: "a", href: item.path };
content = (
<IconButton
{...commonProps}
{...linkProps}
onClick={onNavigate}
/>
<IconButton {...commonProps} {...linkProps} onClick={onNavigate} />
);
}
@ -211,7 +208,6 @@ const SidebarRoot = ({
const logoutTitle = exitElement?.props?.title || "خروج";
const logoutIcon = exitElement?.props?.icon || IoExit;
const resolvedCurrentPath =
currentPath ??
(typeof window !== "undefined"
@ -222,9 +218,7 @@ const SidebarRoot = ({
const secondaryItems = items.slice(primaryMobileCount);
const disabled = (item) => {
const permissions = Array.isArray(item?.perm)
? item.perm
: [item?.perm];
const permissions = Array.isArray(item?.perm) ? item.perm : [item?.perm];
return permissions.filter(Boolean).some((permission) => cannot(permission));
};