Skip to content

Commit f746997

Browse files
authored
feat(dapp): add missing page titles - part 2 styling (#6978)
# Motivation From [NNS1-3834](https://dfinity.atlassian.net/browse/NNS1-3834): update and uniform titles for all pages. **This is part 2 (only design).** # Changes Changed the styling of the buttons in the header toolbar. ![localhost_5173_(iPhone 12 Pro) (1)](https://github.com/user-attachments/assets/15fbfe59-1b28-4cd1-83bf-421ae1cbd4ff) ![localhost_5173_(iPhone 12 Pro)](https://github.com/user-attachments/assets/0bc58859-fb47-424d-becf-b733f0daead6) ![localhost_5173_](https://github.com/user-attachments/assets/85948d09-7d48-4499-84fb-a5518281d7fa) ![localhost_5173_ (1)](https://github.com/user-attachments/assets/fd06f150-eee7-49da-8182-0ee4c945d6d7) # Tests Tested desktop + mobile, dark and light themes. CI should pass. # Todos - [x] Accessibility (a11y) – any impact? - [x] Changelog – is it needed? [NNS1-3834]: https://dfinity.atlassian.net/browse/NNS1-3834?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 31bd976 commit f746997

26 files changed

+36
-36
lines changed

frontend/src/lib/components/header/AccountMenu.svelte

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
import LinkToCanisters from "$lib/components/header/LinkToCanisters.svelte";
55
import LinkToReporting from "$lib/components/header/LinkToReporting.svelte";
66
import LinkToSettings from "$lib/components/header/LinkToSettings.svelte";
7-
import LoginIconOnly from "$lib/components/header/LoginIconOnly.svelte";
87
import Logout from "$lib/components/header/Logout.svelte";
98
import ManageInternetIdentityButton from "$lib/components/header/ManageInternetIdentityButton.svelte";
109
import ToggleBalancePrivacyOption from "$lib/components/header/ToggleBalancePrivacyOption.svelte";
1110
import { authSignedInStore } from "$lib/derived/auth.derived";
11+
import { login } from "$lib/services/auth.services";
1212
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";
1415
1516
let visible = false;
1617
let button: HTMLButtonElement | undefined;
@@ -22,11 +23,11 @@
2223
<TestIdWrapper testId="account-menu-component">
2324
{#if $authSignedInStore}
2425
<button
25-
data-tid="account-menu"
26+
aria-label={$i18n.header.account_menu}
2627
class="icon-only toggle"
28+
data-tid="account-menu"
2729
bind:this={button}
2830
on:click={toggle}
29-
aria-label={$i18n.header.account_menu}
3031
>
3132
<IconUser />
3233
</button>
@@ -49,22 +50,34 @@
4950
</div>
5051
</Popover>
5152
{: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>
5362
{/if}
5463
</TestIdWrapper>
5564

5665
<style lang="scss">
5766
@use "@dfinity/gix-components/dist/styles/mixins/header";
5867
5968
.info {
60-
width: 100%;
61-
62-
display: flex;
6369
flex-direction: column;
6470
gap: var(--padding-3x);
71+
display: flex;
72+
width: 100%;
6573
}
6674
67-
.toggle {
75+
.toggle,
76+
:global([data-tid="menu-toggle"]) {
6877
@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;
6982
}
7083
</style>

frontend/src/lib/components/header/LoginIconOnly.svelte

Lines changed: 0 additions & 26 deletions
This file was deleted.

frontend/src/lib/components/header/Title.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
<style lang="scss">
2222
@use "@dfinity/gix-components/dist/styles/mixins/text";
23-
@use "@dfinity/gix-components/dist/styles/mixins/media";
2423
2524
h1 {
25+
background-color: var(--sidebar-button-background);
2626
@include text.truncate;
27+
border-radius: 45px;
28+
padding: 4px 12px;
2729
line-height: 20px;
2830
font-size: 14px;
2931
margin: 0;

frontend/src/lib/components/layout/Content.svelte

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,14 @@
2121
{/snippet}
2222
{@render children()}
2323
</Content>
24+
25+
<style lang="scss">
26+
@use "@dfinity/gix-components/dist/styles/mixins/layout";
27+
28+
:global(.content .toolbar .back) {
29+
background-color: var(--sidebar-button-background);
30+
min-width: 0 !important;
31+
height: 28px;
32+
width: 28px;
33+
}
34+
</style>
Loading
Loading

0 commit comments

Comments
 (0)