willba-component-library 0.1.23 → 0.1.24
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 +2 -2
- package/lib/components/FilterBar/hooks/useFilterBar.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/FilterBarTypes.ts +2 -2
- package/src/components/FilterBar/components/guests/GuestCount/GuestCount.tsx +2 -2
- package/src/components/FilterBar/components/guests/Guests.tsx +3 -2
- package/src/components/FilterBar/hooks/useFilterBar.tsx +3 -2
package/package.json
CHANGED
|
@@ -11,14 +11,14 @@ export interface AgeCategoryType {
|
|
|
11
11
|
|
|
12
12
|
export interface GuestsPropsType {
|
|
13
13
|
ageCategories: AgeCategoryType[]
|
|
14
|
-
updateGuestsCount: (arg1:
|
|
14
|
+
updateGuestsCount: (arg1: string, arg2: number) => void
|
|
15
15
|
ageCategoryCounts: AgeCategoryCount | {}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface GuestsCountPropsType {
|
|
19
19
|
label: string
|
|
20
20
|
id: number
|
|
21
|
-
updateGuestsCount: (arg1:
|
|
21
|
+
updateGuestsCount: (arg1: string, arg2: number) => void
|
|
22
22
|
count: number
|
|
23
23
|
minVal: number
|
|
24
24
|
sortOrder: number
|
|
@@ -14,12 +14,12 @@ export default function GuestCount({
|
|
|
14
14
|
}: GuestsCountPropsType) {
|
|
15
15
|
const handleDecrement = () => {
|
|
16
16
|
if (count > minVal) {
|
|
17
|
-
updateGuestsCount(id
|
|
17
|
+
updateGuestsCount(`guests-${id}`, count - 1)
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const handleIncrement = () => {
|
|
22
|
-
updateGuestsCount(id
|
|
22
|
+
updateGuestsCount(`guests-${id}`, count + 1)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -24,8 +24,9 @@ export default function Guests({
|
|
|
24
24
|
sortOrder={category.sortOrder}
|
|
25
25
|
updateGuestsCount={updateGuestsCount}
|
|
26
26
|
count={
|
|
27
|
-
(ageCategoryCounts as AgeCategoryCount)[
|
|
28
|
-
|
|
27
|
+
(ageCategoryCounts as AgeCategoryCount)[
|
|
28
|
+
`guests-${category.id}`
|
|
29
|
+
] || category.minVal
|
|
29
30
|
}
|
|
30
31
|
/>
|
|
31
32
|
))}
|
|
@@ -19,10 +19,11 @@ export default function useFilterBar({ redirectUrl }: UseFilterBarPropsType) {
|
|
|
19
19
|
{}
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
const updateGuestsCount = (id:
|
|
22
|
+
const updateGuestsCount = (id: string, newCount: number) => {
|
|
23
|
+
console.log(ageCategoryCounts)
|
|
23
24
|
setAgeCategoryCounts((prevCounts) => ({
|
|
24
25
|
...prevCounts,
|
|
25
|
-
[
|
|
26
|
+
[id]: newCount,
|
|
26
27
|
}))
|
|
27
28
|
}
|
|
28
29
|
|