fix sidebar
This commit is contained in:
parent
0ddd3427ae
commit
685774b577
38
dist/layout.js
vendored
38
dist/layout.js
vendored
File diff suppressed because one or more lines are too long
@ -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));
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user