refactor(web): folder view (#11967)

refactor(web): tree view
This commit is contained in:
Jason Rasmussen 2024-08-22 11:38:19 -04:00 committed by GitHub
parent 296bbeb2fc
commit f69ce6ad8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 135 additions and 159 deletions

View file

@ -1,32 +0,0 @@
<script lang="ts">
import { onMount } from 'svelte';
import { page } from '$app/stores';
import FolderTree from '$lib/components/folder-tree/folder-tree.svelte';
import { buildFolderTree, type RecursiveObject } from '$lib/utils/folder-utils';
import { foldersStore } from '$lib/stores/folders.store';
import { get } from 'svelte/store';
import { t } from 'svelte-i18n';
let folderTree: RecursiveObject = {};
$: currentPath = $page.url.searchParams.get('folder') || '';
onMount(async () => {
await foldersStore.fetchUniquePaths();
});
$: {
const { uniquePaths } = get(foldersStore);
if (uniquePaths && uniquePaths.length > 0) {
folderTree = buildFolderTree(uniquePaths);
}
}
</script>
<section id="folder-browser-sidebar">
<div class="text-xs pl-4 mb-4 dark:text-white">{$t('explorer').toUpperCase()}</div>
<div class="overflow-auto pb-10 immich-scrollbar">
{#each Object.entries(folderTree) as [folderName, content]}
<FolderTree {folderName} {content} {currentPath} basePath="" />
{/each}
</div>
</section>

View file

@ -1,8 +0,0 @@
<script lang="ts">
import SideBarSection from '$lib/components/shared-components/side-bar/side-bar-section.svelte';
import FolderBrowserSidebar from '$lib/components/shared-components/side-bar/folder-browser-sidebar.svelte';
</script>
<SideBarSection>
<FolderBrowserSidebar />
</SideBarSection>