willba-component-library 0.1.23 → 0.1.25
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 +8 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +8 -7
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +8 -7
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.tsx +12 -7
- 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
|
@@ -111,13 +111,18 @@ export default function FilterBar({
|
|
|
111
111
|
style={fontWeightBold(selectedFilter === 1)}
|
|
112
112
|
/>
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
{selectedPath === '/rooms' && (
|
|
115
|
+
<>
|
|
116
|
+
<Divider />
|
|
117
|
+
|
|
118
|
+
<SelectButton
|
|
119
|
+
label={'Who'}
|
|
120
|
+
description={'Add Guests'}
|
|
121
|
+
onClick={() => handleSelectedFilter(2)}
|
|
122
|
+
style={fontWeightBold(selectedFilter === 2)}
|
|
123
|
+
/>
|
|
124
|
+
</>
|
|
125
|
+
)}
|
|
121
126
|
|
|
122
127
|
<SubmitButton onClick={handleSubmit} />
|
|
123
128
|
</div>
|
|
@@ -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
|
|