fix sidebar
This commit is contained in:
parent
2565d1fe73
commit
bef84797bf
201
dist/layout.js
vendored
201
dist/layout.js
vendored
File diff suppressed because one or more lines are too long
@ -20,10 +20,43 @@ import {
|
|||||||
useDisclosure,
|
useDisclosure,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { Children, forwardRef, isValidElement, useRef } from "react";
|
import { Children, forwardRef, isValidElement, useRef } from "react";
|
||||||
import { IoEllipsisHorizontal, IoExit } from "react-icons/io5";
|
|
||||||
import { logoutKeycloak } from "../core/keycloak.jsx";
|
import { logoutKeycloak } from "../core/keycloak.jsx";
|
||||||
import { usePermission } from "../core/permission.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 normalizeSidebarPath = (value = "") => {
|
||||||
const path = String(value).split(/[?#]/)[0] || "";
|
const path = String(value).split(/[?#]/)[0] || "";
|
||||||
|
|
||||||
@ -227,7 +260,7 @@ const SidebarRoot = ({
|
|||||||
);
|
);
|
||||||
const hasExit = Boolean(exitElement);
|
const hasExit = Boolean(exitElement);
|
||||||
const logoutTitle = exitElement?.props?.title || "خروج";
|
const logoutTitle = exitElement?.props?.title || "خروج";
|
||||||
const logoutIcon = exitElement?.props?.icon || IoExit;
|
const logoutIcon = exitElement?.props?.icon || LogOutIcon;
|
||||||
|
|
||||||
const resolvedCurrentPath =
|
const resolvedCurrentPath =
|
||||||
currentPath ??
|
currentPath ??
|
||||||
@ -368,7 +401,7 @@ const SidebarRoot = ({
|
|||||||
color={isSecondaryItemActive ? "blue.600" : "gray.600"}
|
color={isSecondaryItemActive ? "blue.600" : "gray.600"}
|
||||||
bg={isSecondaryItemActive ? "blue.50" : "transparent"}
|
bg={isSecondaryItemActive ? "blue.50" : "transparent"}
|
||||||
>
|
>
|
||||||
<Icon as={IoEllipsisHorizontal} boxSize={5} />
|
<Icon as={EllipsisIcon} boxSize={5} />
|
||||||
<Text
|
<Text
|
||||||
fontSize="10px"
|
fontSize="10px"
|
||||||
fontWeight={isSecondaryItemActive ? "bold" : "medium"}
|
fontWeight={isSecondaryItemActive ? "bold" : "medium"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user