willba-component-library 0.1.48 → 0.1.50
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/components/FilterBar/FilterBarTypes.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +5 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +5 -5
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -1
- package/src/components/FilterBar/FilterBarTypes.ts +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +5 -7
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ 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) =>
|
|
48
|
+
<FilterBar {...args} onSubmit={(val: Filters) => null} />
|
|
49
49
|
</div>
|
|
50
50
|
),
|
|
51
51
|
}
|
|
@@ -92,7 +92,7 @@ export const useFilterBar = ({
|
|
|
92
92
|
? format(calendarRange.from, 'yyyy-MM-dd')
|
|
93
93
|
: '',
|
|
94
94
|
endDate: calendarRange?.to ? format(calendarRange.to, 'yyyy-MM-dd') : '',
|
|
95
|
-
categories,
|
|
95
|
+
categories: categories.toString(),
|
|
96
96
|
ageCategoryCounts: handleAgeCategoryRules({
|
|
97
97
|
ageCategoryCounts,
|
|
98
98
|
ageCategories,
|
|
@@ -121,15 +121,13 @@ export const useFilterBar = ({
|
|
|
121
121
|
|
|
122
122
|
handleSelectedFilter(false)
|
|
123
123
|
|
|
124
|
-
if (onSubmit) {
|
|
125
|
-
const updatedParamsObject: { [key: string]: string
|
|
124
|
+
if (onSubmit && selectedPath === '/rooms') {
|
|
125
|
+
const updatedParamsObject: { [key: string]: string } = {}
|
|
126
126
|
|
|
127
127
|
updatedParams.forEach((value, key) => {
|
|
128
|
-
updatedParamsObject[key] = value
|
|
128
|
+
if (value) updatedParamsObject[key] = value
|
|
129
129
|
})
|
|
130
130
|
|
|
131
|
-
console.log('sdasdasdsad', updatedParamsObject)
|
|
132
|
-
|
|
133
131
|
return onSubmit(updatedParamsObject)
|
|
134
132
|
}
|
|
135
133
|
|
|
@@ -145,7 +143,7 @@ export const useFilterBar = ({
|
|
|
145
143
|
|
|
146
144
|
handleSelectedFilter(false)
|
|
147
145
|
|
|
148
|
-
return onSubmit
|
|
146
|
+
return onSubmit && selectedPath === '/rooms'
|
|
149
147
|
? onSubmit(newParams)
|
|
150
148
|
: (window.location.href = `${redirectUrl}/${selectedPath}${
|
|
151
149
|
querySearchParams ? `?${querySearchParams.toString()}` : ''
|