willba-component-library 0.1.81 → 0.1.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.1.81",
3
+ "version": "0.1.83",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -47,7 +47,6 @@ export const Primary: Story = {
47
47
  secondary: '',
48
48
  },
49
49
  mode: 'dark',
50
- defaultTab: '/rooms',
51
50
  tabs: [
52
51
  {
53
52
  path: '/rooms',
@@ -75,14 +75,17 @@ export const useFilterBar = ({
75
75
 
76
76
  const findMatchingPath = () => {
77
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
- )
78
+
79
+ for (const path of paths) {
80
+ if (window.location.pathname.includes(path)) {
81
+ return path
82
+ }
83
+ }
84
+
85
+ return defaultTab ? defaultTab.path : Pages.EVENTS
83
86
  }
84
87
 
85
- const currentPath = findMatchingPath() || Pages.EVENTS
88
+ const currentPath = findMatchingPath()
86
89
  setSelectedPath(currentPath)
87
90
  }, [])
88
91
 
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ import Button from './components/Button'
2
2
  import FilterBar from './components/FilterBar'
3
3
 
4
4
  export { Button, FilterBar }
5
+ export type { Tab } from './components/FilterBar/FilterBarTypes'