willba-component-library 0.1.80 → 0.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.esm.js +8 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +8 -8
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +8 -8
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +10 -9
package/package.json
CHANGED
|
@@ -68,20 +68,21 @@ export const useFilterBar = ({
|
|
|
68
68
|
}, [selectedFilter])
|
|
69
69
|
|
|
70
70
|
useEffect(() => {
|
|
71
|
-
// Handle default selected tab
|
|
72
71
|
if (typeof window === 'undefined') return
|
|
72
|
+
|
|
73
73
|
const defaultTab =
|
|
74
74
|
tabs?.length === 1 ? tabs[0] : tabs?.find((tab) => tab.default)
|
|
75
75
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
defaultTab
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
const findMatchingPath = () => {
|
|
77
|
+
const paths = [Pages.EVENTS, Pages.ROOMS]
|
|
78
|
+
return paths.find(
|
|
79
|
+
(path) =>
|
|
80
|
+
window.location.pathname.includes(path) ||
|
|
81
|
+
(defaultTab && defaultTab.path === path)
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
84
|
|
|
85
|
+
const currentPath = findMatchingPath() || Pages.EVENTS
|
|
85
86
|
setSelectedPath(currentPath)
|
|
86
87
|
}, [])
|
|
87
88
|
|