Skip to content

Commit 74cc368

Browse files
authored
Update layout match dashboard (#173)
* Update footer and some css * More CSS and layout changes * Session timeout layout and letters layout update * Reset letters check. * Fix external link icon formatting. * More component style updates. * Update styling of letters, app-bar, footer * Update tests * Run Prettier * More test updates
1 parent 094b26a commit 74cc368

37 files changed

Lines changed: 4259 additions & 464 deletions

frontend/app/.server/express/assets/403.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</div>
2828
</header>
2929
<main class="container">
30-
<h1 id="wb-cont" class="wb-inv">Forbidden</h1>
30+
<h1 id="wb-cont font-lato md:text-[41px] md:leading-[1.17]" class="wb-inv">Forbidden</h1>
3131
<div class="row mrgn-tp-lg mrgn-bttm-lg">
3232
<div class="col-md-12">
3333
<div class="row">
@@ -39,11 +39,13 @@ <h1 id="wb-cont" class="wb-inv">Forbidden</h1>
3939
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
4040
</div>
4141
<div class="col-xs-9 col-sm-10 col-md-10">
42-
<h2 class="mrgn-tp-md">Sorry, this is not allowed</h2>
43-
<p class="pagetag"><b>Error 403</b></p>
42+
<h2 class="mrgn-tp-md md:text-[39px] md:leading-[1.23]">Sorry, this is not allowed</h2>
43+
<p class="pagetag md:text-[20px] md:leading-[1.6]"><b>Error 403</b></p>
4444
</div>
4545
</div>
46-
<p>You have requested a Web page or resource that you aren't allowed to access.</p>
46+
<p class="md:text-[20px] md:leading-[1.6]">
47+
You have requested a Web page or resource that you aren't allowed to access.
48+
</p>
4749
</div>
4850
</div>
4951
</section>
@@ -55,11 +57,13 @@ <h2 class="mrgn-tp-md">Sorry, this is not allowed</h2>
5557
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
5658
</div>
5759
<div class="col-xs-9 col-sm-10 col-md-10">
58-
<h2 class="mrgn-tp-md">Désolé, ceci n'est pas permis</h2>
59-
<p class="pagetag"><b>Erreur 403</b></p>
60+
<h2 class="mrgn-tp-md md:text-[39px] md:leading-[1.23]">Désolé, ceci n'est pas permis</h2>
61+
<p class="pagetag md:text-[20px] md:leading-[1.6]"><b>Erreur 403</b></p>
6062
</div>
6163
</div>
62-
<p>Vous avez demandé une page Web ou une ressource à laquelle vous n'avez pas les droits d'accès.</p>
64+
<p class="md:text-[20px] md:leading-[1.6]">
65+
Vous avez demandé une page Web ou une ressource à laquelle vous n'avez pas les droits d'accès.
66+
</p>
6367
</div>
6468
</div>
6569
</section>

frontend/app/.server/express/assets/500.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</div>
2828
</header>
2929
<main class="container">
30-
<h1 id="wb-cont" class="wb-inv">Internal Server Error</h1>
30+
<h1 id="wb-cont font-lato md:text-[41px] md:leading-[1.17]" class="wb-inv">Internal Server Error</h1>
3131
<div class="row mrgn-tp-lg mrgn-bttm-lg">
3232
<div class="col-md-12">
3333
<div class="row">
@@ -39,15 +39,15 @@ <h1 id="wb-cont" class="wb-inv">Internal Server Error</h1>
3939
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
4040
</div>
4141
<div class="col-xs-9 col-sm-10 col-md-10">
42-
<h2 class="mrgn-tp-md">We're having a problem with that page</h2>
43-
<p class="pagetag"><b>Error 500</b></p>
42+
<h2 class="mrgn-tp-md md:text-[39px] md:leading-[1.23]">We're having a problem with that page</h2>
43+
<p class="pagetag md:text-[20px] md:leading-[1.6]"><b>Error 500</b></p>
4444
</div>
4545
</div>
46-
<p>
46+
<p class="md:text-[20px] md:leading-[1.6]">
4747
We expect the problem to be fixed shortly. It's not your computer or Internet connection but a problem with
4848
our website's server.
4949
</p>
50-
<p>Thank you for your patience.</p>
50+
<p class="md:text-[20px] md:leading-[1.6]">Thank you for your patience.</p>
5151
</div>
5252
</div>
5353
</section>
@@ -59,15 +59,17 @@ <h2 class="mrgn-tp-md">We're having a problem with that page</h2>
5959
<span class="glyphicon glyphicon-warning-sign glyphicon-error"></span>
6060
</div>
6161
<div class="col-xs-9 col-sm-10 col-md-10">
62-
<h2 class="mrgn-tp-md">Nous éprouvons des difficultés avec cette page</h2>
63-
<p class="pagetag"><b>Erreur 500</b></p>
62+
<h2 class="mrgn-tp-md md:text-[39px] md:leading-[1.23]">
63+
Nous éprouvons des difficultés avec cette page
64+
</h2>
65+
<p class="pagetag md:text-[20px] md:leading-[1.6]"><b>Erreur 500</b></p>
6466
</div>
6567
</div>
66-
<p>
68+
<p class="md:text-[20px] md:leading-[1.6]">
6769
Nous espérons résoudre le problème sous peu. Il ne s'agit pas d'un problème avec votre ordinateur ou
6870
Internet, mais plutôt avec le serveur de notre site Web. Que faire?
6971
</p>
70-
<p>Merci de votre patience.</p>
72+
<p class="md:text-[20px] md:leading-[1.6]">Merci de votre patience.</p>
7173
</div>
7274
</div>
7375
</section>

frontend/app/.server/locales/gcweb-en.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"app": {
33
"account": "Account",
4-
"logout": "Logout",
5-
"profile": "Profile",
6-
"profile.href": "{{baseUri}}/en/profile",
4+
"logout": "Sign Out",
5+
"profile": "Profile and preferences",
6+
"profile.href": "{{baseUri}}/en/profile-and-preferences",
77
"security-settings": "Security Settings",
88
"security-settings.href": "{{baseUri}}/en/security-settings",
99
"contact-us": "Contact Us",
@@ -31,11 +31,12 @@
3131
"href": "{{baseUri}}/TC.aspx?mode=ReadOnly&lang=eng#privacy",
3232
"text": "Privacy"
3333
},
34-
"service-canada": "Service Canada",
34+
"service-canada": "My Service Canada Account",
3535
"terms-conditions": {
3636
"href": "{{baseUri}}/TC.aspx?mode=ReadOnly&lang=eng#terms",
3737
"text": "Terms and conditions"
38-
}
38+
},
39+
"top-of-page": "Top of Page"
3940
},
4041
"header": {
4142
"govt-of-canada.text": "Government of Canada",
@@ -48,7 +49,8 @@
4849
},
4950
"language": "English",
5051
"language-switcher": {
51-
"alt-lang": "Français"
52+
"alt-lang": "Français",
53+
"alt-lang-abbr": "FR"
5254
},
5355
"nav": {
5456
"skip-to-about": "Skip to About this site",
@@ -76,9 +78,12 @@
7678
"page-title": "We're having a problem with that page"
7779
},
7880
"session-timeout": {
79-
"continue-session": "Continue session",
80-
"description": "Your session will expire automatically in {{timeRemaining}}. Select \"Continue Session\" to extend your session.",
81-
"end-session": "End session now",
82-
"header": "Session timeout warning"
81+
"continue-session": "Stay signed in",
82+
"intro": "You have not been active for a while so we will sign you out to keep your information secure.",
83+
"remaining-time": "You will be signed out in {{minutes}}",
84+
"time-unit-minutes": " minutes and {{seconds}}",
85+
"time-unit-seconds": " seconds.",
86+
"end-session": "Sign out",
87+
"header": "Stay signed in?"
8388
}
8489
}

frontend/app/.server/locales/gcweb-fr.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"app": {
33
"account": "Compte",
4-
"logout": "Déconnexion",
5-
"profile": "Profil",
6-
"profile.href": "{{baseUri}}/fr/profil",
4+
"logout": "Se déconnecter",
5+
"profile": "Profil et préférences",
6+
"profile.href": "{{baseUri}}/fr/profil-et-preferences",
77
"security-settings": "Paramètres de sécurité",
88
"security-settings.href": "{{baseUri}}/fr/parametres-securite",
99
"contact-us": "Contactez-nous",
@@ -31,11 +31,12 @@
3131
"href": "{{baseUri}}/TC.aspx?mode=ReadOnly&lang=fra#privacy",
3232
"text": "Confidentialité"
3333
},
34-
"service-canada": "Service Canada",
34+
"service-canada": "Mon dossier Service Canada",
3535
"terms-conditions": {
3636
"href": "{{baseUri}}/TC.aspx?mode=ReadOnly&lang=fra#terms",
3737
"text": "Avis"
38-
}
38+
},
39+
"top-of-page": "Haut de la page"
3940
},
4041
"header": {
4142
"govt-of-canada.text": "Gouvernement du Canada",
@@ -48,7 +49,8 @@
4849
},
4950
"language": "Français",
5051
"language-switcher": {
51-
"alt-lang": "English"
52+
"alt-lang": "English",
53+
"alt-lang-abbr": "EN"
5254
},
5355
"nav": {
5456
"skip-to-about": "Passer à «\u00a0À propos de ce site\u00a0»",
@@ -76,9 +78,12 @@
7678
"page-title": "Nous éprouvons des difficultés avec cette page"
7779
},
7880
"session-timeout": {
79-
"continue-session": "Continuer la session",
80-
"description": "Votre session expirera automatiquement dans {{timeRemaining}}. Sélectionnez «\u00a0Continuer la session\u00a0» pour prolonger votre session.",
81-
"end-session": "Mettre fin à la session",
82-
"header": "Avertissement d'expiration de la session"
81+
"continue-session": "Rester connecté",
82+
"intro": "Vous n'avez pas été actif depuis un certain temps. Nous allons donc vous déconnecter afin de protéger vos renseignements.",
83+
"remaining-time": "Vous serez déconnecté dans {{minutes}}",
84+
"time-unit-minutes": " minutes et {{seconds}}",
85+
"time-unit-seconds": " secondes.",
86+
"end-session": "Fermer la session",
87+
"header": "Rester connecté?"
8388
}
8489
}
Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import { useState } from 'react';
12
import type { JSX } from 'react';
23

3-
import { faChevronDown, faRightFromBracket, faUser } from '@fortawesome/free-solid-svg-icons';
4+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
45
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
56
import { useTranslation } from 'react-i18next';
67

7-
import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuTrigger } from '~/components/dropdown-menu';
8+
import { getIcon } from './material-icon';
9+
10+
import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuTrigger } from '~/components/dropdown-menu';
811
import { AppLink } from '~/components/links';
912
import { MenuItem } from '~/components/menu';
1013
import { useLanguage } from '~/hooks/use-language';
@@ -19,16 +22,26 @@ export function AppBar({ name }: AppBarProps): JSX.Element {
1922
const { MSCA_BASE_URL } = globalThis.__appEnvironment;
2023

2124
return (
22-
<div className="bg-slate-700">
23-
<div className="align-center container mx-auto flex flex-wrap justify-between">
24-
<div className="align-center flex">
25-
<span id="menu-label" className="my-auto py-2 text-white sm:text-2xl">
26-
<AppLink to={t('gcweb:app.menu-dashboard.href', { baseUri: MSCA_BASE_URL })} className="hover:underline">
25+
<div className="sm:bg-blue-primary sm:h-15">
26+
<div className="align-center mx-auto flex flex-wrap justify-between sm:container sm:flex-nowrap">
27+
<div className="bg-blue-primary order-1 flex h-15 w-full sm:w-auto">
28+
<span id="menu-label" className="my-auto px-3 md:px-1">
29+
<AppLink
30+
to={t('gcweb:app.menu-dashboard.href', { baseUri: MSCA_BASE_URL })}
31+
className="font-lato my-auto px-3 text-[19px] font-bold text-white hover:underline md:px-1 md:text-2xl"
32+
>
2733
{t('gcweb:app.title')}
2834
</AppLink>
2935
</span>
3036
</div>
31-
<div className="flex items-center space-x-4 text-right">{name && <UserButton name={name} />}</div>
37+
<div className="ring-blue-hover items-left order-2 flex w-full text-right text-2xl ring-offset-2 focus:ring-2 focus:outline-none sm:order-3 sm:w-65 lg:order-3">
38+
{name && (
39+
<UserButton
40+
className="ring-blue-hover focus:ring-blue-hover active:ring-blue-hover ring-offset-2 focus:ring-2 active:ring-2"
41+
name={name}
42+
/>
43+
)}
44+
</div>
3245
</div>
3346
</div>
3447
);
@@ -42,86 +55,73 @@ type UserButtonProps = {
4255
function UserButton({ className, name }: UserButtonProps): JSX.Element {
4356
const { t } = useTranslation(['gcweb']);
4457
const { currentLanguage } = useLanguage();
58+
const [open, setOpen] = useState(false);
4559
const { MSCA_BASE_URL, SHOW_INBOX_MENU } = globalThis.__appEnvironment;
4660

4761
return (
48-
<DropdownMenu>
62+
<DropdownMenu open={open} onOpenChange={setOpen}>
4963
<DropdownMenuTrigger
5064
className={cn(
51-
'flex h-full flex-nowrap space-x-2 bg-slate-200 px-2 text-sm text-slate-700 hover:bg-neutral-300 hover:underline focus:bg-neutral-300 focus:ring-2 focus:ring-black focus:ring-offset-2 focus:outline-hidden aria-expanded:bg-neutral-300 aria-expanded:text-slate-700 sm:space-x-4 sm:px-4',
65+
'bg-bright-blue-pale text-blue-primary flex h-full w-full flex-nowrap space-x-2 px-4 hover:bg-neutral-300 focus:rounded-md focus:bg-neutral-300 focus:ring-2 focus:ring-black focus:ring-offset-2 focus:outline-hidden aria-expanded:bg-neutral-300 aria-expanded:text-slate-700 sm:space-x-4',
5266
className,
5367
)}
5468
>
55-
<div className="text-md my-auto flex flex-nowrap items-center space-x-2 py-2">
56-
<div className="flex h-8 w-8 items-center justify-center rounded-full bg-slate-700">
57-
<FontAwesomeIcon icon={faUser} className="size-5 text-slate-200" />
58-
</div>
59-
<span id="menu-label" className="text-md hidden py-2 font-bold sm:block">
69+
<div className="my-auto flex flex-nowrap items-center space-x-2 py-2 text-base">
70+
<span className="flex items-center">
71+
<svg className="mr-4" width="35" height="35" viewBox="0 0 35 36" fill="none" xmlns="http://www.w3.org/2000/svg">
72+
<path
73+
d="M17.5 0.499756C7.84 0.499756 0 8.33976 0 17.9998C0 27.6598 7.84 35.4998 17.5 35.4998C27.16 35.4998 35 27.6598 35 17.9998C35 8.33976 27.16 0.499756 17.5 0.499756ZM17.5 7.49976C20.8775 7.49976 23.625 10.2473 23.625 13.6248C23.625 17.0023 20.8775 19.7498 17.5 19.7498C14.1225 19.7498 11.375 17.0023 11.375 13.6248C11.375 10.2473 14.1225 7.49976 17.5 7.49976ZM17.5 31.9998C13.9475 31.9998 9.7475 30.5648 6.755 26.9598C9.7125 24.6498 13.44 23.2498 17.5 23.2498C21.56 23.2498 25.2875 24.6498 28.245 26.9598C25.2525 30.5648 21.0525 31.9998 17.5 31.9998Z"
74+
fill="#26374A"
75+
/>
76+
</svg>
77+
</span>
78+
<span id="menu-label" className="ring-blue-hover ml-2 py-2 font-sans text-base font-bold">
6079
{name}
6180
</span>
6281
</div>
63-
<FontAwesomeIcon icon={faChevronDown} className="my-auto size-4" />
82+
<FontAwesomeIcon icon={open ? faChevronUp : faChevronDown} className="my-auto ml-auto size-4" />
6483
</DropdownMenuTrigger>
65-
<DropdownMenuContent align="end" className="w-64">
66-
<UserName name={name} />
84+
<DropdownMenuContent align="start" sideOffset={0} className="w-(--radix-dropdown-menu-trigger-width) focus:outline-none">
6785
<MenuItem
6886
to={t('gcweb:app.menu-dashboard.href', { baseUri: MSCA_BASE_URL })}
69-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
87+
className="text-deep-blue-dark hover:text-blue-hover flex justify-between text-base focus:bg-white"
7088
>
7189
{t('gcweb:app.menu-dashboard')}
7290
</MenuItem>
91+
<DropdownMenuSeparator />
7392
<MenuItem
7493
to={t('gcweb:app.profile.href', { baseUri: MSCA_BASE_URL })}
75-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
94+
className="text-deep-blue-dark hover:text-blue-hover flex justify-between text-base focus:bg-white"
7695
>
7796
{t('gcweb:app.profile')}
7897
</MenuItem>
98+
<DropdownMenuSeparator />
7999
{SHOW_INBOX_MENU && (
80-
<MenuItem
81-
to={t('gcweb:app.inbox.href', { baseUri: MSCA_BASE_URL })}
82-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
83-
>
84-
{t('gcweb:app.inbox')}
85-
</MenuItem>
100+
<>
101+
<MenuItem
102+
to={t('gcweb:app.inbox.href', { baseUri: MSCA_BASE_URL })}
103+
className="text-deep-blue-dark hover:text-blue-hover flex justify-between text-base focus:bg-white"
104+
>
105+
{t('gcweb:app.inbox')}
106+
</MenuItem>
107+
<DropdownMenuSeparator />
108+
</>
86109
)}
87-
<MenuItem
88-
to={t('gcweb:app.security-settings.href', { baseUri: MSCA_BASE_URL })}
89-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
90-
>
91-
{t('gcweb:app.security-settings')}
92-
</MenuItem>
93110
<MenuItem
94111
to={t('gcweb:app.contact-us.href', { baseUri: MSCA_BASE_URL })}
95-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
112+
className="text-deep-blue-dark hover:text-blue-hover flex justify-between text-base focus:bg-white"
96113
>
97114
{t('gcweb:app.contact-us')}
98115
</MenuItem>
99-
<div role="separator" aria-orientation="horizontal" className="-mx-1 my-1 h-px bg-slate-100"></div>
116+
<DropdownMenuSeparator />
100117
<MenuItem
101118
to={`/auth/logout?lang=${currentLanguage}`}
102-
className="text-md flex justify-between text-black hover:bg-zinc-100 hover:text-black focus:bg-zinc-100 active:bg-zinc-100"
119+
className="text-deep-blue-dark hover:text-blue-hover flex text-base focus:bg-white"
103120
>
121+
{getIcon('logout')}
104122
{t('gcweb:app.logout')}
105-
<FontAwesomeIcon icon={faRightFromBracket} className="my-auto size-8" />
106123
</MenuItem>
107124
</DropdownMenuContent>
108125
</DropdownMenu>
109126
);
110127
}
111-
112-
type UserNameProps = {
113-
name?: string;
114-
};
115-
116-
function UserName({ name }: UserNameProps): JSX.Element {
117-
return (
118-
<>
119-
{name !== undefined && (
120-
<DropdownMenuLabel className="text-md flex items-center border-b-2 border-slate-600 px-3 py-2 text-gray-300 sm:hidden">
121-
<FontAwesomeIcon icon={faUser} className="mr-2 size-4" />
122-
{name}
123-
</DropdownMenuLabel>
124-
)}
125-
</>
126-
);
127-
}

0 commit comments

Comments
 (0)