mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 06:34:24 +01:00
feat: auto-close sidebar on mobile when navigating to content
- Add effect to close sidebar when route changes on mobile - Handles clicking on blog posts in Explore view - Complements existing sidebar auto-close for bookmarks and highlights - Improves mobile UX by preventing sidebar from blocking content
This commit is contained in:
3
.cursor/rules/mobile-first-ui-ux.mdc
Normal file
3
.cursor/rules/mobile-first-ui-ux.mdc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
@@ -90,6 +90,14 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
|||||||
setHighlightVisibility
|
setHighlightVisibility
|
||||||
} = useBookmarksUI({ settings })
|
} = useBookmarksUI({ settings })
|
||||||
|
|
||||||
|
// Close sidebar on mobile when route changes (e.g., clicking on blog posts in Explore)
|
||||||
|
useEffect(() => {
|
||||||
|
if (isMobile && isSidebarOpen) {
|
||||||
|
toggleSidebar()
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [location.pathname])
|
||||||
|
|
||||||
const {
|
const {
|
||||||
bookmarks,
|
bookmarks,
|
||||||
bookmarksLoading,
|
bookmarksLoading,
|
||||||
|
|||||||
Reference in New Issue
Block a user