willba-component-library 0.1.24 → 0.1.26
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/index.esm.js +11 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +11 -6
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +11 -6
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.css +0 -3
- package/src/components/FilterBar/FilterBar.tsx +13 -7
- package/src/components/FilterBar/components/guests/Guests.css +0 -2
- package/src/components/FilterBar/hooks/useFilterBar.tsx +5 -3
package/package.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
width: 100%;
|
|
4
4
|
max-height: 100vh;
|
|
5
5
|
position: relative;
|
|
6
|
-
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
.will-filter-bar {
|
|
@@ -14,14 +13,12 @@
|
|
|
14
13
|
.will-filter-bar-underlay {
|
|
15
14
|
background-color: transparent;
|
|
16
15
|
position: absolute;
|
|
17
|
-
/* top:0; */
|
|
18
16
|
left: 0;
|
|
19
17
|
width: 100%;
|
|
20
18
|
height: 100%;
|
|
21
19
|
cursor: pointer;
|
|
22
20
|
min-height: 500vh;
|
|
23
21
|
z-index: 88888;
|
|
24
|
-
|
|
25
22
|
transform: translateY(-50%);
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -64,6 +64,7 @@ export default function FilterBar({
|
|
|
64
64
|
|
|
65
65
|
const targetFilterBarRef = useRef<HTMLDivElement | null>(null)
|
|
66
66
|
useEffect(() => {
|
|
67
|
+
if (window !== undefined && window.innerWidth < 960) return
|
|
67
68
|
if (targetFilterBarRef.current && selectedFilter) {
|
|
68
69
|
window.scrollTo({
|
|
69
70
|
behavior: 'smooth',
|
|
@@ -111,13 +112,18 @@ export default function FilterBar({
|
|
|
111
112
|
style={fontWeightBold(selectedFilter === 1)}
|
|
112
113
|
/>
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
{selectedPath === '/rooms' && (
|
|
116
|
+
<>
|
|
117
|
+
<Divider />
|
|
118
|
+
|
|
119
|
+
<SelectButton
|
|
120
|
+
label={'Who'}
|
|
121
|
+
description={'Add Guests'}
|
|
122
|
+
onClick={() => handleSelectedFilter(2)}
|
|
123
|
+
style={fontWeightBold(selectedFilter === 2)}
|
|
124
|
+
/>
|
|
125
|
+
</>
|
|
126
|
+
)}
|
|
121
127
|
|
|
122
128
|
<SubmitButton onClick={handleSubmit} />
|
|
123
129
|
</div>
|
|
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
|
|
|
2
2
|
import { DateRange } from 'react-day-picker'
|
|
3
3
|
import { format } from 'date-fns'
|
|
4
4
|
|
|
5
|
-
import { AgeCategoryCount
|
|
5
|
+
import { AgeCategoryCount } from '../FilterBarTypes'
|
|
6
6
|
|
|
7
7
|
interface UseFilterBarPropsType {
|
|
8
8
|
redirectUrl: string
|
|
@@ -20,7 +20,6 @@ export default function useFilterBar({ redirectUrl }: UseFilterBarPropsType) {
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
const updateGuestsCount = (id: string, newCount: number) => {
|
|
23
|
-
console.log(ageCategoryCounts)
|
|
24
23
|
setAgeCategoryCounts((prevCounts) => ({
|
|
25
24
|
...prevCounts,
|
|
26
25
|
[id]: newCount,
|
|
@@ -79,7 +78,10 @@ export default function useFilterBar({ redirectUrl }: UseFilterBarPropsType) {
|
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
useEffect(() => {
|
|
82
|
-
|
|
81
|
+
if (typeof window === 'undefined') return
|
|
82
|
+
|
|
83
|
+
document.body.style.overflow =
|
|
84
|
+
selectedFilter && window.innerWidth < 960 ? 'hidden' : 'visible'
|
|
83
85
|
|
|
84
86
|
return () => {
|
|
85
87
|
document.body.style.overflow = 'visible'
|