willba-component-library 0.1.49 → 0.1.51

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.49",
3
+ "version": "0.1.51",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -45,7 +45,10 @@ export const Primary: Story = {
45
45
  },
46
46
  render: (args) => (
47
47
  <div style={{ background: 'grey', padding: '30px', height: '100vh' }}>
48
- <FilterBar {...args} onSubmit={(val: Filters) => null} />
48
+ <FilterBar
49
+ {...args}
50
+ onSubmit={true ? null : (val: Filters) => console.log(val)}
51
+ />
49
52
  </div>
50
53
  ),
51
54
  }
@@ -37,7 +37,7 @@ export type FilterBarProps = {
37
37
  redirectUrl?: string
38
38
  palette?: Palette
39
39
  currentViewApply?: string
40
- onSubmit?: (val: Filters) => void
40
+ onSubmit?: ((val: Filters) => void) | null
41
41
  }
42
42
 
43
43
  export default function FilterBar({
@@ -8,7 +8,7 @@ type Props = {
8
8
  redirectUrl?: string
9
9
  currentViewApply?: string
10
10
  ageCategories?: AgeCategoryType[]
11
- onSubmit?: (val: Filters) => void
11
+ onSubmit?: ((val: Filters) => void) | null
12
12
  }
13
13
 
14
14
  export const useFilterBar = ({
@@ -142,7 +142,7 @@ export const useFilterBar = ({
142
142
  }
143
143
 
144
144
  handleSelectedFilter(false)
145
-
145
+ console.log(onSubmit ? 'eeee' : 'tttt')
146
146
  return onSubmit
147
147
  ? onSubmit(newParams)
148
148
  : (window.location.href = `${redirectUrl}/${selectedPath}${