@c-rex/ui 0.1.12 → 0.1.14

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": "@c-rex/ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -2,9 +2,8 @@ import { useEffect, useState } from "react";
2
2
  import { BREAKPOINTS, DEVICE_OPTIONS } from "@c-rex/constants";
3
3
  import { DeviceType } from "@c-rex/types";
4
4
 
5
-
6
- export const useBreakpoint = (): DeviceType => {
7
- const [device, setDevice] = useState<DeviceType>(DEVICE_OPTIONS.MOBILE);
5
+ export const useBreakpoint = (): DeviceType | null => {
6
+ const [device, setDevice] = useState<DeviceType | null>(null);
8
7
 
9
8
  useEffect(() => {
10
9
  function handleResize() {
package/src/sidebar.tsx CHANGED
@@ -81,7 +81,7 @@ const MultiSidebarProvider = React.forwardRef<
81
81
  ref
82
82
  ) => {
83
83
  const device = useBreakpoint();
84
- const isMobile = (device === DEVICE_OPTIONS.MOBILE || device === DEVICE_OPTIONS.TABLET);
84
+ const isMobile = device !== null && (device === DEVICE_OPTIONS.MOBILE || device === DEVICE_OPTIONS.TABLET);
85
85
 
86
86
  // Left Sidebar State
87
87
  const [_leftOpen, _setLeftOpen] = React.useState(defaultLeftOpen);