Index: document/src/assets/css/globals.css =================================================================== diff -u -r776752fd3297266014bee3533d793eeb8a6e887a -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/assets/css/globals.css (.../globals.css) (revision 776752fd3297266014bee3533d793eeb8a6e887a) +++ document/src/assets/css/globals.css (.../globals.css) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -73,3 +73,10 @@ 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } + +/* global lucide icon size */ +/* 루시드 아이콘 전역 사이즈 변경 */ +.lucide { + width: 14px; + height: 14px; +} \ No newline at end of file Index: document/src/assets/css/test.css =================================================================== diff -u -rbfa639b0757c551624056d960e3b76006fba85b2 -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/assets/css/test.css (.../test.css) (revision bfa639b0757c551624056d960e3b76006fba85b2) +++ document/src/assets/css/test.css (.../test.css) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -62,7 +62,7 @@ position:absolute; left:0; top:0; - width:100px; + width:130px; height:100px; background:url(../images/313_logo.png) no-repeat; background-size:100%; Index: document/src/components/shadcn/ui/accordion.jsx =================================================================== diff -u -rbfa639b0757c551624056d960e3b76006fba85b2 -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/components/shadcn/ui/accordion.jsx (.../accordion.jsx) (revision bfa639b0757c551624056d960e3b76006fba85b2) +++ document/src/components/shadcn/ui/accordion.jsx (.../accordion.jsx) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -18,7 +18,7 @@ svg.chevronDown]:rotate-180", + "flex flex-1 items-center justify-between py-4 text-sm transition-all [&[data-state=open]>svg.chevronDown]:rotate-180", className )} {...props}> Index: document/src/contexts/contexts.jsx =================================================================== diff -u -r4e0101938600b3c890feeefa4fbc1e6be914b130 -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/contexts/contexts.jsx (.../contexts.jsx) (revision 4e0101938600b3c890feeefa4fbc1e6be914b130) +++ document/src/contexts/contexts.jsx (.../contexts.jsx) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -1,4 +1,4 @@ -import { createContext, useEffect, useState } from "react" +import { createContext, useEffect, useState, useCallback } from "react" import { MonitorDown, Gauge, @@ -9,10 +9,27 @@ ChartLine, Handshake, } from "lucide-react" +import { useLocation } from 'react-router-dom'; +export function useActiveLink() { + const [activeLink, setActiveLink] = useState(''); + const location = useLocation(); + + useEffect(() => { + setActiveLink(location.pathname); + }, [location]); + + const handleSetActiveLink = useCallback((path) => { + setActiveLink(path); + }, []); + + return { activeLink, handleSetActiveLink }; +} + export const SubMenuContext = createContext(); export const SubMenuContextProvider = ({children}) => { + const { activeLink, handleSetActiveLink } = useActiveLink(); const value = [ { @@ -105,7 +122,7 @@ ]; return ( - + {children} ); Index: document/src/layout/HeaderMenu.component.jsx =================================================================== diff -u -ra1b82c3f3fefbd315243221c0efe5b1f7d7df660 -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/layout/HeaderMenu.component.jsx (.../HeaderMenu.component.jsx) (revision a1b82c3f3fefbd315243221c0efe5b1f7d7df660) +++ document/src/layout/HeaderMenu.component.jsx (.../HeaderMenu.component.jsx) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -1,13 +1,5 @@ import { Link } from 'react-router-dom'; -import { Menu, Settings } from "lucide-react" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, - } from "@/components/shadcn/ui/dropdown-menu" +import { Menu } from "lucide-react" import { Button } from "@/components/shadcn/ui/button" import { Sheet, SheetContent, SheetTrigger } from "@/components/shadcn/ui/sheet" import { SubMenu } from './HeaderMenu' @@ -16,7 +8,7 @@ return ( <> {/* 모바일 Breakpoint 좌측 사이드 메뉴 -- mobile menu & top right menu start -- */} -
+
- - - My Account - - Settings - Support - - Logout - - - {/* 상단 세팅 아이콘 메뉴 End -- Top account dropdown menu end -- */}
) Index: document/src/layout/HeaderMenu.jsx =================================================================== diff -u -ra1b82c3f3fefbd315243221c0efe5b1f7d7df660 -r7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349 --- document/src/layout/HeaderMenu.jsx (.../HeaderMenu.jsx) (revision a1b82c3f3fefbd315243221c0efe5b1f7d7df660) +++ document/src/layout/HeaderMenu.jsx (.../HeaderMenu.jsx) (revision 7a06d3dd8d4b01bb052b5a0c080f4effd8ea3349) @@ -9,31 +9,45 @@ } from "@/components/shadcn/ui/accordion" -export const AccordionMenu = ({ title, to }) => { +export const AccordionMenu = ({ title, to, isActive }) => { return ( - - {title} + + {title} ) } export const SubMenu = () => { - const subMenuItems = useContext(SubMenuContext) + const { menuItems, activeLink } = useContext(SubMenuContext); return ( <> - {subMenuItems.map((item, index) => + {menuItems.map((item, index) => { + const isActive = activeLink === item.to; + const combinedClassName = ` + ${isActive ? `active bg-gray-100 !text-blue-400` : ''} + ${item.className || ''} + `.trim(); + + return ( item.subMenus && item.subMenus.length > 0 ? ( // 메뉴 Data에 서브메뉴가 있을 시 아코디언 컴포넌트로 출력 - + - - + + {item.title} -
+
{/* 아코디언 서브 메뉴 출력 */} {item.subMenus.map((el) => ( - + ))} {/* 아코디언 서브 메뉴 출력 END */}
@@ -44,13 +58,15 @@ - + className={`flex items-center gap-3 rounded-lg px-3 py-2 !max-sm:text-white lg:text-white dark:text-white transition-all hover:text-blue-400 hover:bg-muted ${combinedClassName}` } + > + {item.title} - ) - )} + )) + } + ) + } ) } @@ -60,14 +76,14 @@ <>
-
+
{/* 상단 브랜드 로고 -- Page Header -- */}
-