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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -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
- <Divider />
115
- <SelectButton
116
- label={'Who'}
117
- description={'Add Guests'}
118
- onClick={() => handleSelectedFilter(2)}
119
- style={fontWeightBold(selectedFilter === 2)}
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>
@@ -17,8 +17,6 @@
17
17
  .will-guests-filter-container {
18
18
  display: flex;
19
19
  flex-direction: column;
20
- min-width: 300px;
21
-
22
20
  }
23
21
 
24
22
 
@@ -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, AgeCategoryType } from '../FilterBarTypes'
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
- document.body.style.overflow = selectedFilter ? 'hidden' : 'visible'
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'