mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): common layout for user pages (#1995)
* refactor(web): common layout for user pages * remove unused imports
This commit is contained in:
parent
dd02f1025f
commit
9a332074c7
17 changed files with 437 additions and 552 deletions
47
web/src/lib/components/layouts/user-page-layout.svelte
Normal file
47
web/src/lib/components/layouts/user-page-layout.svelte
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<script lang="ts">
|
||||
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';
|
||||
|
||||
export let user: UserResponseDto;
|
||||
export let hideNavbar = false;
|
||||
export let showUploadButton = false;
|
||||
export let title: string | undefined = undefined;
|
||||
</script>
|
||||
|
||||
<header>
|
||||
{#if !hideNavbar}
|
||||
<NavigationBar
|
||||
{user}
|
||||
shouldShowUploadButton={showUploadButton}
|
||||
on:uploadClicked={() => openFileUploadDialog()}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<slot name="header" />
|
||||
</header>
|
||||
|
||||
<main
|
||||
class="grid grid-cols-[250px_auto] relative pt-[4.25rem] h-screen bg-immich-bg dark:bg-immich-dark-bg immich-scrollbar"
|
||||
>
|
||||
<SideBar />
|
||||
|
||||
<slot name="content">
|
||||
<section class="my-8 mx-4 bg-immich-bg dark:bg-immich-dark-bg">
|
||||
{#if title}
|
||||
<div class="flex justify-between place-items-center dark:text-immich-dark-fg px-4 h-10">
|
||||
<p class="font-medium">{title}</p>
|
||||
|
||||
<slot name="buttons" />
|
||||
</div>
|
||||
|
||||
<div class="my-4">
|
||||
<hr class="dark:border-immich-dark-gray" />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<slot />
|
||||
</section>
|
||||
</slot>
|
||||
</main>
|
||||
|
|
@ -40,14 +40,14 @@
|
|||
|
||||
<section
|
||||
id="dashboard-navbar"
|
||||
class="fixed w-screen z-[900] bg-immich-bg dark:bg-immich-dark-bg text-sm"
|
||||
class="fixed h-[4.25rem] w-screen z-[900] bg-immich-bg dark:bg-immich-dark-bg text-sm"
|
||||
>
|
||||
<div
|
||||
class="grid grid-cols-[250px_auto] border-b dark:border-b-immich-dark-gray items-center py-2"
|
||||
>
|
||||
<a
|
||||
data-sveltekit-preload-data="hover"
|
||||
class="flex gap-2 px-6 place-items-center hover:cursor-pointer"
|
||||
class="flex gap-2 mx-6 place-items-center"
|
||||
href={AppRoute.PHOTOS}
|
||||
>
|
||||
<ImmichLogo height="35" width="35" />
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<form
|
||||
autocomplete="off"
|
||||
class="relative text-base"
|
||||
class="relative text-sm"
|
||||
action={AppRoute.SEARCH}
|
||||
on:reset={() => (value = '')}
|
||||
on:submit|preventDefault={onSearch}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue