Merge pull request #2320 from appwrite/fix-sidebar-on-small-viewport

This commit is contained in:
Darshan authored and GitHub committed 2025-09-04 10:13:47 +05:30
commit f6700faf5a
2 files changed
+9 -1

No files matched your search

+8
View File
@@ -18,6 +18,7 @@
import { page } from '$app/stores';
import type { Models } from '@appwrite.io/console';
import { getSidebarState, isInDatabasesRoute, updateSidebarState } from '$lib/helpers/sidebar';
import { isTabletViewport } from '$lib/stores/viewport';
export let showHeader = true;
export let showFooter = true;
@@ -100,8 +101,15 @@
*
* This needs to be handled like this because
* the setup around the sidebar is very tightly configured with 2 states sync.
*
* The sidebar is **always closed** on mobile and tablet devices!
*/
afterNavigate((navigation) => {
if ($isTabletViewport) {
state = 'closed';
return;
}
const isEnteringDatabase = isInDatabasesRoute(navigation.to.route);
const isLeavingDatabase =
isInDatabasesRoute(navigation.from.route) && !isInDatabasesRoute(navigation.to.route);
@@ -134,7 +134,7 @@
</div>
</section>
</Sidebar.Base>
{:else}
{:else if data?.database?.name}
<Navbar.Base>
<div slot="left">
<Layout.Stack direction="row" alignItems="center" gap="s">