Skip to content

Commit 8102995

Browse files
committed
added nested side nav click handler
1 parent f3106ae commit 8102995

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

library/src/components/sidenavigation/SideNavigation.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ type _NestingItemProps = {
454454
title: string // title is used to identify the item and as a key
455455
sideNavStoreIdent?: string
456456
id: string
457+
onClick?: () => void
457458
}
458459

459460
function NestingItem({
@@ -462,6 +463,7 @@ function NestingItem({
462463
style,
463464
sideNavStoreIdent = "default",
464465
title,
466+
onClick,
465467
_isOpen,
466468
id,
467469
}: _NestingItemProps & { _isOpen?: boolean }) {
@@ -491,6 +493,7 @@ function NestingItem({
491493
pushPathElement(id)
492494
setTransitioning(true)
493495
window.setTimeout(() => setTransitioning(null), animTime * 1000)
496+
onClick?.()
494497
}}
495498
iconAfter={
496499
<ArrowRightIcon
@@ -513,6 +516,7 @@ type _NestableNavigationContentProps = {
513516
sideNavStoreIdent?: string
514517
onAnimationStart?: () => void
515518
onAnimationComplete?: () => void
519+
onGoBackClick?: () => void
516520
}
517521

518522
function searchChild(
@@ -547,6 +551,7 @@ function NestableNavigationContent({
547551
style,
548552
onAnimationStart,
549553
onAnimationComplete,
554+
onGoBackClick,
550555
}: _NestableNavigationContentProps) {
551556
const { popPathElement, getCurrentPathElement, setTransitioning, path } =
552557
useSideNavigationStore(sideNavStoreIdent)
@@ -616,6 +621,7 @@ function NestableNavigationContent({
616621
)
617622
})
618623
}, 0)
624+
onGoBackClick?.()
619625
}}
620626
>
621627
{goBackLabel}

package-lock.json

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"@tanstack/react-query": "^5.69.0",
134134
"@total-typescript/ts-reset": "^0.6.1",
135135
"@types/node": "^22.13.10",
136-
"@types/react": "^18.3.18",
136+
"@types/react": "^18.3.19",
137137
"@types/react-dom": "^18.3.5",
138138
"@vitejs/plugin-react-swc": "^3.8.1",
139139
"eslint-plugin-react-refresh": "^0.4.19",
@@ -158,7 +158,7 @@
158158
"peerDependencies": {
159159
"@tailwindcss/vite": "^4.0.3",
160160
"@tanstack/react-query": "^5.68.0",
161-
"axios": "^1.8.3",
161+
"axios": "^1.8.4",
162162
"react": "^18.3.1",
163163
"react-dom": "^18.3.1",
164164
"react-hook-form": "^7.54.2",

0 commit comments

Comments
 (0)