|
4 | 4 | import LinkToCanisters from "$lib/components/header/LinkToCanisters.svelte";
|
5 | 5 | import LinkToReporting from "$lib/components/header/LinkToReporting.svelte";
|
6 | 6 | import LinkToSettings from "$lib/components/header/LinkToSettings.svelte";
|
7 |
| - import LoginIconOnly from "$lib/components/header/LoginIconOnly.svelte"; |
8 | 7 | import Logout from "$lib/components/header/Logout.svelte";
|
9 | 8 | import ManageInternetIdentityButton from "$lib/components/header/ManageInternetIdentityButton.svelte";
|
10 | 9 | import ToggleBalancePrivacyOption from "$lib/components/header/ToggleBalancePrivacyOption.svelte";
|
11 | 10 | import { authSignedInStore } from "$lib/derived/auth.derived";
|
| 11 | + import { login } from "$lib/services/auth.services"; |
12 | 12 | import { i18n } from "$lib/stores/i18n";
|
13 |
| - import { IconUser, Popover } from "@dfinity/gix-components"; |
| 13 | + import { layoutAuthReady } from "$lib/stores/layout.store"; |
| 14 | + import { IconLogin, IconUser, Popover } from "@dfinity/gix-components"; |
14 | 15 |
|
15 | 16 | let visible = false;
|
16 | 17 | let button: HTMLButtonElement | undefined;
|
|
22 | 23 | <TestIdWrapper testId="account-menu-component">
|
23 | 24 | {#if $authSignedInStore}
|
24 | 25 | <button
|
25 |
| - data-tid="account-menu" |
| 26 | + aria-label={$i18n.header.account_menu} |
26 | 27 | class="icon-only toggle"
|
| 28 | + data-tid="account-menu" |
27 | 29 | bind:this={button}
|
28 | 30 | on:click={toggle}
|
29 |
| - aria-label={$i18n.header.account_menu} |
30 | 31 | >
|
31 | 32 | <IconUser />
|
32 | 33 | </button>
|
|
49 | 50 | </div>
|
50 | 51 | </Popover>
|
51 | 52 | {:else}
|
52 |
| - <LoginIconOnly /> |
| 53 | + <button |
| 54 | + class="icon-only toggle" |
| 55 | + aria-label={$i18n.auth.login} |
| 56 | + disabled={!$layoutAuthReady} |
| 57 | + data-tid="toolbar-login" |
| 58 | + on:click={login} |
| 59 | + > |
| 60 | + <IconLogin /> |
| 61 | + </button> |
53 | 62 | {/if}
|
54 | 63 | </TestIdWrapper>
|
55 | 64 |
|
56 | 65 | <style lang="scss">
|
57 | 66 | @use "@dfinity/gix-components/dist/styles/mixins/header";
|
58 | 67 |
|
59 | 68 | .info {
|
60 |
| - width: 100%; |
61 |
| -
|
62 |
| - display: flex; |
63 | 69 | flex-direction: column;
|
64 | 70 | gap: var(--padding-3x);
|
| 71 | + display: flex; |
| 72 | + width: 100%; |
65 | 73 | }
|
66 | 74 |
|
67 |
| - .toggle { |
| 75 | + .toggle, |
| 76 | + :global([data-tid="menu-toggle"]) { |
68 | 77 | @include header.button(--primary-tint);
|
| 78 | + background-color: var(--sidebar-button-background); |
| 79 | + min-width: 0 !important; |
| 80 | + height: 28px !important; |
| 81 | + width: 28px !important; |
69 | 82 | }
|
70 | 83 | </style>
|
0 commit comments