diff --git a/src/components/Page/index.tsx b/src/components/Page/index.tsx index 1919561..f4778d1 100644 --- a/src/components/Page/index.tsx +++ b/src/components/Page/index.tsx @@ -55,7 +55,7 @@ function Page(props: Props) { onSwipeRight, } = props; - const { width } = useContext(SizeContext); + const { screen } = useContext(SizeContext); const [storedConfig, setStoredConfig] = useLocalStorage('timur-config'); @@ -117,11 +117,11 @@ function Page(props: Props) { !startSidebarShown && styles.startSidebarCollapsed, debouncedStartSidebarCollapsed && styles.debouncedStartSidebarCollapsed, debouncedEndSidebarCollapsed && styles.debouncedEndSidebarCollapsed, - (!endSidebarShown || width <= 900) && styles.endSidebarCollapsed, + (!endSidebarShown || screen === 'mobile') && styles.endSidebarCollapsed, startSidebarShown && !!startAsideContent && styles.startSidebarVisible, endSidebarShown && !!endAsideContent - && width > 900 + && screen === 'desktop' && styles.endSidebarVisible, className, )} @@ -160,7 +160,7 @@ function Page(props: Props) { {children} - {endAsideContent && width > 900 && ( + {endAsideContent && screen === 'desktop' && ( - {windowWidth >= 900 && ( + {screen === 'desktop' && ( )} - {windowWidth >= 900 && ( + {screen === 'desktop' && (