diff --git a/app/components/Header/MobileMenu.vue b/app/components/Header/MobileMenu.vue index 3aeab273a..197186732 100644 --- a/app/components/Header/MobileMenu.vue +++ b/app/components/Header/MobileMenu.vue @@ -5,6 +5,7 @@ const isOpen = defineModel('open', { default: false }) const { isConnected, npmUser, avatar: npmAvatar } = useConnector() const { user: atprotoUser } = useAtproto() +const { backgroundThemes, setBackgroundTheme, selectedBackgroundTheme } = useBackgroundTheme() const navRef = useTemplateRef('navRef') const { activate, deactivate } = useFocusTrap(navRef, { allowOutsideClick: true }) @@ -29,6 +30,22 @@ function handleShowAuth() { } } +function cycleTheme() { + const currentIndex = backgroundThemes.findIndex(t => t.id === selectedBackgroundTheme.value) + const nextIndex = (currentIndex + 1) % backgroundThemes.length + setBackgroundTheme(backgroundThemes[nextIndex].id) +} + +function handleSearch() { + closeMenu() + navigateTo('/search') +} + +function handleSettings() { + closeMenu() + navigateTo('/settings') +} + // Close menu on route change const route = useRoute() watch(() => route.fullPath, closeMenu) @@ -51,244 +68,246 @@ onUnmounted(deactivate)