mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #2320 from appwrite/fix-sidebar-on-small-viewport
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -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);
|
||||
|
||||
+1
-1
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user