@vrobots/storybook 0.1.71 → 0.1.72
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/dist/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export const Sidebar = forwardRef((props, ref) => {
|
|
|
30
30
|
const { colorMode } = useColorMode();
|
|
31
31
|
const breakpoint = useBreakpoint();
|
|
32
32
|
const isMobile = useIsMobile();
|
|
33
|
+
const [mounted, setMounted] = React.useState(false);
|
|
33
34
|
const width = {
|
|
34
35
|
base: '100vw',
|
|
35
36
|
sm: '100vw',
|
|
@@ -44,12 +45,15 @@ export const Sidebar = forwardRef((props, ref) => {
|
|
|
44
45
|
transition: { duration: 0.2 }
|
|
45
46
|
};
|
|
46
47
|
const close = {
|
|
47
|
-
initial: { width: width[breakpoint || 'base'] },
|
|
48
|
+
initial: { width: !mounted ? '0' : width[breakpoint || 'base'] },
|
|
48
49
|
animate: { width: '0' },
|
|
49
50
|
transition: { duration: 0.2 }
|
|
50
51
|
};
|
|
51
52
|
const action = isMobile ? sidebar.isOpen ? open : close : {};
|
|
52
53
|
const borderColor = colorMode === 'light' ? COLOR_GRAY_200 : COLOR_GRAY_800;
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
setMounted(true);
|
|
56
|
+
}, []);
|
|
53
57
|
if (!sidebar.menu)
|
|
54
58
|
return null;
|
|
55
59
|
return (_jsx(React.Fragment, { children: _jsx(motion.div, { style: {
|