|
5 | 5 | import TimezoneSelect from '$lib/components/timezone-select.svelte';
|
6 | 6 | import Button from '$lib/holocene/button.svelte';
|
7 | 7 | import Combobox from '$lib/holocene/combobox/combobox.svelte';
|
8 |
| - import { |
9 |
| - Menu, |
10 |
| - MenuButton, |
11 |
| - MenuContainer, |
12 |
| - MenuItem, |
13 |
| - } from '$lib/holocene/menu'; |
14 | 8 | import { translate } from '$lib/i18n/translate';
|
15 |
| - import { authUser } from '$lib/stores/auth-user'; |
16 | 9 | import { dataEncoder } from '$lib/stores/data-encoder';
|
17 | 10 | import { lastUsedNamespace } from '$lib/stores/namespaces';
|
18 | 11 | import type { NamespaceListItem } from '$lib/types/global';
|
19 | 12 | import { routeForNamespace } from '$lib/utilities/route-for';
|
20 | 13 |
|
21 |
| - export let logout: () => void; |
22 | 14 | export let namespaceList: NamespaceListItem[] = [];
|
23 |
| - export let userEmaiLink = ''; |
24 | 15 |
|
25 | 16 | let screenWidth: number;
|
26 | 17 |
|
|
37 | 28 | (namespaceListItem) => namespaceListItem.namespace === namespace,
|
38 | 29 | );
|
39 | 30 |
|
40 |
| - let showProfilePic = true; |
41 |
| -
|
42 |
| - function fixImage() { |
43 |
| - showProfilePic = false; |
44 |
| - } |
45 |
| -
|
46 | 31 | const handleNamespaceSelect = (
|
47 | 32 | event: CustomEvent<{ value: NamespaceListItem }>,
|
48 | 33 | ) => {
|
|
53 | 38 | </script>
|
54 | 39 |
|
55 | 40 | <svelte:window bind:innerWidth={screenWidth} />
|
56 |
| - |
57 | 41 | <nav
|
58 | 42 | class="surface-primary sticky top-0 z-40 flex hidden w-full flex-col items-center justify-end border-b border-subtle p-1 px-4 md:flex md:flex-row md:px-8"
|
59 | 43 | data-testid="top-nav"
|
|
73 | 57 | optionValueKey="namespace"
|
74 | 58 | on:change={handleNamespaceSelect}
|
75 | 59 | minSize={32}
|
| 60 | + actionTooltip={translate('namespaces.go-to-namespace')} |
76 | 61 | >
|
77 | 62 | <Button
|
78 | 63 | slot="action"
|
|
87 | 72 | <div class="flex items-center gap-2">
|
88 | 73 | <TimezoneSelect position={screenWidth < 768 ? 'left' : 'right'} />
|
89 | 74 | <DataEncoderStatus />
|
90 |
| - {#if $authUser.accessToken} |
91 |
| - <MenuContainer> |
92 |
| - <MenuButton variant="ghost" hasIndicator controls="user-menu"> |
93 |
| - <img |
94 |
| - src={$authUser?.picture} |
95 |
| - alt={$authUser?.profile ?? translate('common.user-profile')} |
96 |
| - class="h-[24px] w-[24px] cursor-pointer rounded-md" |
97 |
| - on:error={fixImage} |
98 |
| - class:hidden={!showProfilePic} |
99 |
| - /> |
100 |
| - <div |
101 |
| - class="aspect-square h-full w-[24px] rounded-md bg-blue-200 p-0.5" |
102 |
| - class:hidden={showProfilePic} |
103 |
| - > |
104 |
| - {#if $authUser?.name} |
105 |
| - <div class="text-center text-sm text-black"> |
106 |
| - {$authUser?.name.trim().charAt(0)} |
107 |
| - </div> |
108 |
| - {/if} |
109 |
| - </div> |
110 |
| - </MenuButton> |
111 |
| - <Menu id="user-menu" position="right"> |
112 |
| - <MenuItem href={userEmaiLink} disabled={!userEmaiLink}> |
113 |
| - {$authUser.email} |
114 |
| - </MenuItem> |
115 |
| - <MenuItem on:click={logout}>{translate('common.log-out')}</MenuItem> |
116 |
| - </Menu> |
117 |
| - </MenuContainer> |
118 |
| - {/if} |
| 75 | + <slot /> |
119 | 76 | </div>
|
120 | 77 | </nav>
|
0 commit comments