2023-03-18 22:31:15 +01:00
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
import { openFileUploadDialog } from '$lib/utils/file-uploader';
|
|
|
|
|
import type { UserResponseDto } from '@api';
|
|
|
|
|
import NavigationBar from '../shared-components/navigation-bar/navigation-bar.svelte';
|
|
|
|
|
import SideBar from '../shared-components/side-bar/side-bar.svelte';
|
2023-10-13 11:02:28 -04:00
|
|
|
import AdminSideBar from '../shared-components/side-bar/admin-side-bar.svelte';
|
|
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
export let user: UserResponseDto;
|
|
|
|
|
export let hideNavbar = false;
|
|
|
|
|
export let showUploadButton = false;
|
|
|
|
|
export let title: string | undefined = undefined;
|
2023-08-04 17:07:15 -04:00
|
|
|
export let scrollbar = true;
|
2023-10-13 11:02:28 -04:00
|
|
|
export let admin = false;
|
2023-08-04 17:07:15 -04:00
|
|
|
|
|
|
|
|
$: scrollbarClass = scrollbar ? 'immich-scrollbar p-4 pb-8' : 'scrollbar-hidden pl-4';
|
2023-03-18 22:31:15 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<header>
|
2023-07-01 00:50:47 -04:00
|
|
|
{#if !hideNavbar}
|
|
|
|
|
<NavigationBar {user} {showUploadButton} on:uploadClicked={() => openFileUploadDialog()} />
|
|
|
|
|
{/if}
|
2023-03-18 22:31:15 +01:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot name="header" />
|
2023-03-18 22:31:15 +01:00
|
|
|
</header>
|
|
|
|
|
<main
|
2023-07-18 13:19:39 -05:00
|
|
|
class="relative grid h-screen grid-cols-[theme(spacing.18)_auto] overflow-hidden bg-immich-bg pt-[var(--navbar-height)] dark:bg-immich-dark-bg md:grid-cols-[theme(spacing.64)_auto]"
|
2023-03-18 22:31:15 +01:00
|
|
|
>
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot name="sidebar">
|
2023-10-13 11:02:28 -04:00
|
|
|
{#if admin}
|
|
|
|
|
<AdminSideBar />
|
|
|
|
|
{:else}
|
|
|
|
|
<SideBar />
|
|
|
|
|
{/if}
|
2023-07-01 00:50:47 -04:00
|
|
|
</slot>
|
|
|
|
|
<slot name="content">
|
|
|
|
|
{#if title}
|
|
|
|
|
<section class="relative">
|
|
|
|
|
<div
|
2023-07-18 13:19:39 -05:00
|
|
|
class="absolute flex h-16 w-full place-items-center justify-between border-b p-4 dark:border-immich-dark-gray dark:text-immich-dark-fg"
|
2023-07-01 00:50:47 -04:00
|
|
|
>
|
|
|
|
|
<p class="font-medium">{title}</p>
|
|
|
|
|
<slot name="buttons" />
|
|
|
|
|
</div>
|
2023-03-18 22:31:15 +01:00
|
|
|
|
2023-08-04 17:07:15 -04:00
|
|
|
<div class="{scrollbarClass} absolute top-16 h-[calc(100%-theme(spacing.16))] w-full overflow-y-auto">
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot />
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
{/if}
|
|
|
|
|
</slot>
|
2023-03-18 22:31:15 +01:00
|
|
|
</main>
|