Skip to content

Commit b477d78

Browse files
Merge pull request #135 from linked-planet/dev
Dev
2 parents c4d4889 + 8102995 commit b477d78

File tree

5 files changed

+48
-42
lines changed

5 files changed

+48
-42
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}

library/src/utils/debounce.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export function debounceHelper(delayMS = 300) {
1717
clearTimeout(timer)
1818
}
1919

20-
if (delayMS <= 0) {
21-
throw new Error("delay must be positive and above 0")
20+
if (delayMS < 0) {
21+
throw new Error("delay must be a positive number")
2222
}
2323

2424
timer = window.setTimeout(() => {

library/src/utils/idleRateLimit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export function idleRateLimitHelper(
1313
) {
1414
let lastTime = 0
1515
let timeoutRunning = 0
16-
if (timeoutMS !== undefined && timeoutMS <= 0) {
17-
throw new Error("minDistanceMS must be positive and above 0")
16+
if (timeoutMS !== undefined && timeoutMS < 0) {
17+
throw new Error("timeoutMS must be a positive number")
1818
}
1919

2020
// eslint-disable-next-line @typescript-eslint/no-explicit-any

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@
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",
138-
"@vitejs/plugin-react-swc": "^3.8.0",
138+
"@vitejs/plugin-react-swc": "^3.8.1",
139139
"eslint-plugin-react-refresh": "^0.4.19",
140140
"prettier-plugin-tailwindcss": "^0.6.11",
141141
"process": "^0.11.10",
@@ -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)