diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index daafb4d6c..678c5d968 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -340,19 +340,8 @@ diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/header.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/header.svelte index bee3fa5f0..ceeefa289 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/header.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/header.svelte @@ -6,6 +6,7 @@ import { Cover, CoverTitle } from '$lib/layout'; import { canWriteCollections } from '$lib/stores/roles'; import { collection } from './store'; + import { isTabletViewport } from '$lib/stores/viewport'; $: projectId = $page.params.project; $: databaseId = $page.params.database; @@ -49,24 +50,26 @@ ].filter((tab) => !tab.disabled); - - - - {$collection?.name} - - {#key $collection?.$id} - {$collection?.$id} - {/key} - +
+ + + + {$collection?.name} + + {#key $collection?.$id} + {$collection?.$id} + {/key} + - - {#each tabs as tab} - - {tab.title} - - {/each} - - + + {#each tabs as tab} + + {tab.title} + + {/each} + + +
diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte index ab948a143..076645884 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/subNavigation.svelte @@ -4,8 +4,10 @@ import { showCreate } from '../store'; import type { PageData } from './$types'; import { showSubNavigation } from '$lib/stores/layout'; - import { Icon, Sidebar } from '@appwrite.io/pink-svelte'; - import { IconDatabase, IconTable } from '@appwrite.io/pink-icons-svelte'; + import { Icon, Sidebar, Navbar, Layout, Typography } from '@appwrite.io/pink-svelte'; + import { IconChevronDown, IconDatabase, IconTable } from '@appwrite.io/pink-icons-svelte'; + import { isTabletViewport } from '$lib/stores/viewport'; + import { BottomSheet } from '$lib/components'; $: data = $page.data as PageData; $: project = $page.params.project; @@ -15,52 +17,89 @@ $: sortedCollections = data?.allCollections?.collections?.sort((a, b) => a.$createdAt > b.$createdAt ? -1 : 1 ); + + $: selectedCollection = sortedCollections.find((collection) => collection.$id === collectionId); + + let openBottomSheet = false; - -
- - -
- - {data.database.name} -
-
- {#if data?.allCollections?.total} -
    - {#each sortedCollections as collection} - {@const href = `${base}/project-${project}/databases/database-${databaseId}/collection-${collection.$id}`} - {@const isSelected = collectionId === collection.$id} -
  • - - - {collection.name} - -
  • - {/each} -
- {/if} +{#if !$isTabletViewport} + +
+
+ + {data.database.name} +
+
+ {#if data?.allCollections?.total} +
    + {#each sortedCollections as collection} + {@const href = `${base}/project-${project}/databases/database-${databaseId}/collection-${collection.$id}`} + {@const isSelected = collectionId === collection.$id} +
  • + + + {collection.name} + +
  • + {/each} +
+ {/if} +
+ +
+
+{:else} + +
+ + + {data.database.name} + / + +
- -
-
+ +{/if} +{#if openBottomSheet} + { + return { + name: collection.name, + leadingIcon: IconTable, + href: `${base}/project-${project}/databases/database-${databaseId}/collection-${collection.$id}` + }; + }) + }, + bottom: undefined + }}> +{/if}