수정
This commit is contained in:
@@ -83,8 +83,9 @@ export default function AgentShell({ shop = false }: Props) {
|
||||
setOpenCards((prev) => {
|
||||
const next = { ...prev }
|
||||
sections.forEach((sec) => {
|
||||
// 기본은 접힘. 현재 경로가 속한 섹션만 펼침
|
||||
if (next[sec.id] === undefined) {
|
||||
next[sec.id] = sectionContainsPath(sec, location.pathname) || sec.items.length <= 1
|
||||
next[sec.id] = sectionContainsPath(sec, location.pathname)
|
||||
}
|
||||
if (sectionContainsPath(sec, location.pathname)) next[sec.id] = true
|
||||
})
|
||||
@@ -201,7 +202,7 @@ export default function AgentShell({ shop = false }: Props) {
|
||||
{!collapsed && (
|
||||
<aside className="leftpanel" style={{ width: panelWidth }}>
|
||||
{sections.map((sec) => {
|
||||
const open = openCards[sec.id] !== false
|
||||
const open = openCards[sec.id] === true
|
||||
const activeSec = sectionContainsPath(sec, location.pathname)
|
||||
return (
|
||||
<div className={`lp-card${activeSec ? ' is-active' : ''}`} key={sec.id}>
|
||||
|
||||
Reference in New Issue
Block a user