|
1 | 1 | <script lang="ts">
|
| 2 | + import { page } from '$app/state'; |
2 | 3 | import { focusTrap } from '$lib/actions/focus-trap';
|
| 4 | + import Button from '$lib/components/elements/buttons/button.svelte'; |
3 | 5 | import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
| 6 | + import Icon from '$lib/components/elements/icon.svelte'; |
4 | 7 | import { AppRoute } from '$lib/constants';
|
5 | 8 | import { preferences, user } from '$lib/stores/user.store';
|
6 | 9 | import { handleError } from '$lib/utils/handle-error';
|
|
11 | 14 | import { NotificationType, notificationController } from '../notification/notification';
|
12 | 15 | import UserAvatar from '../user-avatar.svelte';
|
13 | 16 | import AvatarSelector from './avatar-selector.svelte';
|
14 |
| - import ThemeButton from '$lib/components/shared-components/theme-button.svelte'; |
15 |
| - import { Button } from '@immich/ui'; |
16 | 17 |
|
17 | 18 | interface Props {
|
18 | 19 | onLogout: () => void;
|
| 20 | + onClose?: () => void; |
19 | 21 | }
|
20 | 22 |
|
21 |
| - let { onLogout }: Props = $props(); |
| 23 | + let { onLogout, onClose = () => {} }: Props = $props(); |
22 | 24 |
|
23 | 25 | let isShowSelectAvatar = $state(false);
|
24 | 26 |
|
|
46 | 48 | in:fade={{ duration: 100 }}
|
47 | 49 | out:fade={{ duration: 100 }}
|
48 | 50 | id="account-info-panel"
|
49 |
| - class="absolute right-[25px] top-[75px] z-[100] w-[min(360px,100vw-50px)] rounded-3xl px-4 bg-gray-200 shadow-lg dark:border dark:border-immich-dark-gray dark:bg-immich-dark-gray" |
| 51 | + class="absolute right-[25px] top-[75px] z-[100] w-[min(360px,100vw-50px)] rounded-3xl bg-gray-200 shadow-lg dark:border dark:border-immich-dark-gray dark:bg-immich-dark-gray" |
50 | 52 | use:focusTrap
|
51 | 53 | >
|
52 | 54 | <div
|
53 |
| - class="mt-4 flex flex-col items-center justify-center gap-4 rounded-3xl bg-white p-4 dark:bg-immich-dark-primary/10" |
| 55 | + class="mx-4 mt-4 flex flex-col items-center justify-center gap-4 rounded-3xl bg-white p-4 dark:bg-immich-dark-primary/10" |
54 | 56 | >
|
55 | 57 | <div class="relative">
|
56 | 58 | <UserAvatar user={$user} size="xl" />
|
|
70 | 72 | <p class="text-center text-lg font-medium text-immich-primary dark:text-immich-dark-primary">
|
71 | 73 | {$user.name}
|
72 | 74 | </p>
|
73 |
| - <p class="text-center text-sm text-gray-500 dark:text-immich-dark-fg">{$user.email}</p> |
| 75 | + <p class="text-sm text-gray-500 dark:text-immich-dark-fg">{$user.email}</p> |
74 | 76 | </div>
|
75 | 77 |
|
76 | 78 | <div class="flex flex-col gap-1">
|
77 |
| - <Button |
78 |
| - href={AppRoute.USER_SETTINGS} |
79 |
| - leadingIcon={mdiCog} |
80 |
| - variant="outline" |
81 |
| - color="secondary" |
82 |
| - size="small" |
83 |
| - shape="round" |
84 |
| - > |
85 |
| - {$t('account_settings')} |
| 79 | + <Button href={AppRoute.USER_SETTINGS} onclick={onClose} color="dark-gray" size="sm" shadow={false} border> |
| 80 | + <div class="flex place-content-center place-items-center text-center gap-2 px-2"> |
| 81 | + <Icon path={mdiCog} size="18" ariaHidden /> |
| 82 | + {$t('account_settings')} |
| 83 | + </div> |
86 | 84 | </Button>
|
87 | 85 | {#if $user.isAdmin}
|
88 | 86 | <Button
|
89 | 87 | href={AppRoute.ADMIN_USER_MANAGEMENT}
|
90 |
| - leadingIcon={mdiWrench} |
91 |
| - variant="outline" |
92 |
| - color="secondary" |
93 |
| - size="small" |
94 |
| - shape="round" |
| 88 | + onclick={onClose} |
| 89 | + color="dark-gray" |
| 90 | + size="sm" |
| 91 | + shadow={false} |
| 92 | + border |
| 93 | + aria-current={page.url.pathname.includes('/admin') ? 'page' : undefined} |
95 | 94 | >
|
96 |
| - {$t('administration')} |
| 95 | + <div class="flex place-content-center place-items-center text-center gap-2 px-2"> |
| 96 | + <Icon path={mdiWrench} size="18" ariaHidden /> |
| 97 | + {$t('administration')} |
| 98 | + </div> |
97 | 99 | </Button>
|
98 | 100 | {/if}
|
99 | 101 | </div>
|
100 | 102 | </div>
|
101 | 103 |
|
102 |
| - <div class="mb-4 mt-2 flex flex-row justify-center gap-1"> |
103 |
| - <ThemeButton padding="2" /> |
104 |
| - <Button variant="ghost" color="secondary" leadingIcon={mdiLogout} onclick={onLogout}> |
105 |
| - {$t('sign_out')} |
106 |
| - </Button> |
| 104 | + <div class="mb-4 flex flex-col"> |
| 105 | + <button |
| 106 | + type="button" |
| 107 | + class="flex w-full place-content-center place-items-center gap-2 py-3 font-medium text-gray-500 hover:bg-immich-primary/10 dark:text-gray-300" |
| 108 | + onclick={onLogout} |
| 109 | + > |
| 110 | + <Icon path={mdiLogout} size={24} /> |
| 111 | + {$t('sign_out')}</button |
| 112 | + > |
107 | 113 | </div>
|
108 | 114 | </div>
|
109 | 115 |
|
|
0 commit comments