willba-component-library 0.1.22 → 0.1.23

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.22",
3
+ "version": "0.1.23",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -20,24 +20,18 @@ export const Primary: Story = {
20
20
  {
21
21
  id: '2',
22
22
  name: 'Alle 6 vuotiaat',
23
- minAge: null,
24
- maxAge: 6,
25
23
  minVal: 0,
26
24
  sortOrder: 3,
27
25
  },
28
26
  {
29
27
  id: '3',
30
28
  name: '6-16 vuotiaat',
31
- minAge: 6,
32
- maxAge: 17,
33
29
  minVal: 0,
34
30
  sortOrder: 2,
35
31
  },
36
32
  {
37
33
  id: '1',
38
34
  name: 'Aikuiset',
39
- minAge: 17,
40
- maxAge: null,
41
35
  minVal: 2,
42
36
  sortOrder: 1,
43
37
  },
@@ -42,6 +42,7 @@ export default function FilterBar({
42
42
 
43
43
  setRerenderKey((prevKey) => prevKey + 1)
44
44
  }, [language])
45
+
45
46
  const { t } = useTranslation('filterBar')
46
47
 
47
48
  // Filters
@@ -162,16 +163,12 @@ const AGE_CATEGORIES_FALLBACK = [
162
163
  id: '1',
163
164
  name: 'Adults',
164
165
  sortOrder: 1,
165
- minAge: null,
166
- maxAge: 6,
167
166
  minVal: 0,
168
167
  },
169
168
  {
170
169
  id: '2',
171
170
  name: 'Kids',
172
171
  sortOrder: 2,
173
- minAge: 6,
174
- maxAge: 17,
175
172
  minVal: 0,
176
173
  },
177
174
  ]
@@ -5,8 +5,6 @@ export interface AgeCategoryCount {
5
5
  export interface AgeCategoryType {
6
6
  id: string
7
7
  name: string
8
- minAge: number | null
9
- maxAge: number | null
10
8
  minVal: number
11
9
  sortOrder: number
12
10
  }
@@ -22,7 +22,7 @@ export default function useFilterBar({ redirectUrl }: UseFilterBarPropsType) {
22
22
  const updateGuestsCount = (id: number, newCount: number) => {
23
23
  setAgeCategoryCounts((prevCounts) => ({
24
24
  ...prevCounts,
25
- [id]: newCount,
25
+ [`guests-${id}`]: newCount,
26
26
  }))
27
27
  }
28
28
 
@@ -62,7 +62,7 @@ export default function useFilterBar({ redirectUrl }: UseFilterBarPropsType) {
62
62
  : '',
63
63
  endDate: calendarRange?.to ? format(calendarRange.to, 'yyyy-MM-dd') : '',
64
64
  categories,
65
- //ageCategoryCounts: JSON.stringify(ageCategoryCounts),
65
+ ageCategoryCounts: JSON.stringify(ageCategoryCounts),
66
66
  }
67
67
 
68
68
  for (const [key, value] of Object.entries(params)) {