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-20 11:10:49 +03:30
parent 2565d1fe73
commit bef84797bf
2 changed files with 153 additions and 87 deletions

201
dist/layout.js vendored

File diff suppressed because one or more lines are too long

View File

@ -20,10 +20,43 @@ import {
useDisclosure,
} from "@chakra-ui/react";
import { Children, forwardRef, isValidElement, useRef } from "react";
import { IoEllipsisHorizontal, IoExit } from "react-icons/io5";
import { logoutKeycloak } from "../core/keycloak.jsx";
import { usePermission } from "../core/permission.jsx";
const EllipsisIcon = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<circle cx="12" cy="12" r="1" />
<circle cx="19" cy="12" r="1" />
<circle cx="5" cy="12" r="1" />
</svg>
);
const LogOutIcon = (props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="m16 17 5-5-5-5" />
<path d="M21 12H9" />
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
</svg>
);
const normalizeSidebarPath = (value = "") => {
const path = String(value).split(/[?#]/)[0] || "";
@ -227,7 +260,7 @@ const SidebarRoot = ({
);
const hasExit = Boolean(exitElement);
const logoutTitle = exitElement?.props?.title || "خروج";
const logoutIcon = exitElement?.props?.icon || IoExit;
const logoutIcon = exitElement?.props?.icon || LogOutIcon;
const resolvedCurrentPath =
currentPath ??
@ -368,7 +401,7 @@ const SidebarRoot = ({
color={isSecondaryItemActive ? "blue.600" : "gray.600"}
bg={isSecondaryItemActive ? "blue.50" : "transparent"}
>
<Icon as={IoEllipsisHorizontal} boxSize={5} />
<Icon as={EllipsisIcon} boxSize={5} />
<Text
fontSize="10px"
fontWeight={isSecondaryItemActive ? "bold" : "medium"}