@sikka/hawa 0.0.140 → 0.0.141
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/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/hooks/useBreakpoint.ts +9 -4
- package/src/layout/HawaAppLayout.tsx +6 -1
- package/storybook-static/{767.7ed51dff3faa8acf55cd.manager.bundle.js → 767.232e4e4c88bb0a2ed02d.manager.bundle.js} +2 -2
- package/storybook-static/{767.7ed51dff3faa8acf55cd.manager.bundle.js.LICENSE.txt → 767.232e4e4c88bb0a2ed02d.manager.bundle.js.LICENSE.txt} +19 -22
- package/storybook-static/870.32eb3abe.iframe.bundle.js +2 -0
- package/storybook-static/{870.91cc9366.iframe.bundle.js.LICENSE.txt → 870.32eb3abe.iframe.bundle.js.LICENSE.txt} +11 -15
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/{main.ad68749b.iframe.bundle.js → main.f7aca500.iframe.bundle.js} +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.4a2964ac.iframe.bundle.js +1 -0
- package/storybook-static/745.4b81597c.iframe.bundle.js +0 -1
- package/storybook-static/870.91cc9366.iframe.bundle.js +0 -2
- package/storybook-static/runtime~main.0d980255.iframe.bundle.js +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { useState, useEffect } from "react"
|
|
2
2
|
|
|
3
3
|
const useBreakpoint = () => {
|
|
4
|
+
console.log("window is ")
|
|
4
5
|
const [breakpoint, setBreakpoint] = useState(window?.innerWidth)
|
|
5
6
|
const resize = () => {
|
|
6
7
|
setBreakpoint(window?.innerWidth)
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
useEffect(() => {
|
|
10
|
-
window
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
window?.
|
|
11
|
+
if (typeof window !== "undefined") {
|
|
12
|
+
// Client-side-only code
|
|
13
|
+
|
|
14
|
+
window?.addEventListener("resize", resize)
|
|
15
|
+
|
|
16
|
+
return () => {
|
|
17
|
+
window?.removeEventListener("resize", resize)
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
}, [])
|
|
16
21
|
|
|
@@ -31,7 +31,12 @@ export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
|
31
31
|
const { isOpen, onClose, onOpen } = useDiscloser(false)
|
|
32
32
|
const ref = useRef(null)
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
let size
|
|
35
|
+
if (typeof window !== "undefined") {
|
|
36
|
+
size = useBreakpoint()
|
|
37
|
+
} else {
|
|
38
|
+
size = 1200
|
|
39
|
+
}
|
|
35
40
|
console.log("size is ", size)
|
|
36
41
|
useEffect(() => {
|
|
37
42
|
const handleClickOutside = (event) => {
|