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