Skip to content

Commit 74c6824

Browse files
authored
Merge pull request #3675 from IntersectMBO/fix/3622-layout-updates
fix(#3622): apply new design system theme changes to home page
2 parents 0903942 + a931f57 commit 74c6824

File tree

9 files changed

+51
-22
lines changed

9 files changed

+51
-22
lines changed

govtool/frontend/src/components/atoms/Typography.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export const Typography = ({
1212
headline3: 36,
1313
headline4: 32,
1414
headline5: 28,
15+
title: 27,
1516
title1: 24,
17+
titleH3: 23,
1618
title2: 22,
19+
body: 21,
1720
body1: 16,
1821
body2: 14,
1922
caption: 12,
@@ -25,8 +28,11 @@ export const Typography = ({
2528
headline3: 400,
2629
headline4: 600,
2730
headline5: 500,
31+
title: 500,
2832
title1: 400,
33+
titleH3: 500,
2934
title2: 500,
35+
body: 400,
3036
body1: 600,
3137
body2: 500,
3238
caption: 400,
@@ -38,8 +44,11 @@ export const Typography = ({
3844
headline3: "44px",
3945
headline4: "40px",
4046
headline5: "36px",
47+
title: "32px",
48+
titleH3: "32px",
4149
title1: "32px",
4250
title2: "28px",
51+
body: "28px",
4352
body1: "24px",
4453
body2: "20px",
4554
caption: "16px",

govtool/frontend/src/components/atoms/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export type TypographyProps = Pick<
3232
| "headline3"
3333
| "headline4"
3434
| "headline5"
35+
| "title"
36+
| "titleH3"
3537
| "title1"
3638
| "title2"
39+
| "body"
3740
| "body1"
3841
| "body2"
3942
| "caption";

govtool/frontend/src/components/molecules/HomeCard.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,28 @@ export const HomeCard = ({ title, description, onCardClick }: Props) => (
1919
border: "none",
2020
cursor: onCardClick ? "pointer" : "default",
2121
outline: "none",
22+
p: 3.75,
2223
"&:focus": {
2324
boxShadow: "0 0 0 3px rgba(47, 98, 220, 0.5)",
2425
},
26+
"&:hover": {
27+
boxShadow: onCardClick
28+
? "0 0 0 3px rgba(47, 98, 220, 0.5)"
29+
: "2px 2px 20px 0px rgba(47, 98, 220, 0.20)",
30+
},
31+
backgroundColor: "white",
2532
}}
2633
onCardClick={onCardClick}
2734
component="button"
2835
role="button"
2936
aria-label={`${title}. ${description}`}
3037
dataTestId={`home-card-${title.replace(/\s+/g, "-").toLowerCase()}`}
3138
>
32-
<Typography component="h3">{title}</Typography>
33-
<Typography variant="caption">{description}</Typography>
39+
<Typography component="h3" variant="titleH3" sx={{ textAlign: "left" }}>
40+
{title}
41+
</Typography>
42+
<Typography variant="body" sx={{ textAlign: "left" }}>
43+
{description}
44+
</Typography>
3445
</Card>
3546
);

govtool/frontend/src/components/organisms/Home/ConnectWalletTo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const ConnectWalletTo = () => {
106106
return (
107107
<Box my={4} component="section" data-testid="connect-wallet-to-section">
108108
<Box display="flex" justifyContent="space-between" alignItems="center">
109-
<Typography variant="title2">
109+
<Typography variant="title">
110110
{t("home.connectWalletTo.section.title")}
111111
</Typography>
112112
<Button
@@ -125,8 +125,8 @@ export const ConnectWalletTo = () => {
125125
sm: "repeat(2, 1fr)",
126126
lg: "repeat(3, 1fr)",
127127
}}
128-
gap={4}
129-
mt={4}
128+
gap={3.75}
129+
mt={3.75}
130130
>
131131
{CONNECT_WALLET_TO_CARDS.map(({ title, description, path }) => (
132132
<HomeCard

govtool/frontend/src/components/organisms/Home/HelpBuildGovTool.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const HelpBuildGovTool = ({ my = 4 }: { my?: number }) => {
3333

3434
return (
3535
<Box my={my} component="section" data-testid="help-build-govtool-section">
36-
<Typography variant="title2">
36+
<Typography variant="title">
3737
{t("home.helpBuildGovTool.section.title")}
3838
</Typography>
3939
<Box
@@ -43,8 +43,8 @@ export const HelpBuildGovTool = ({ my = 4 }: { my?: number }) => {
4343
sm: "repeat(2, 1fr)",
4444
lg: "repeat(3, 1fr)",
4545
}}
46-
gap={4}
47-
mt={4}
46+
gap={3.75}
47+
mt={3.75}
4848
>
4949
{GOVTOOL_CARD_LINKS.map(({ title, description, url }) => (
5050
<HomeCard

govtool/frontend/src/components/organisms/Home/OpenToAny.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const OpenToAny = () => {
8787
component="section"
8888
data-testid="open-to-any-and-all-users-section"
8989
>
90-
<Typography variant="title2">
90+
<Typography variant="title" component="h2">
9191
{t("home.openToAny.section.title")}
9292
</Typography>
9393
<Box
@@ -97,8 +97,8 @@ export const OpenToAny = () => {
9797
sm: "repeat(2, 1fr)",
9898
lg: "repeat(3, 1fr)",
9999
}}
100-
gap={4}
101-
mt={4}
100+
gap={3.75}
101+
mt={3.75}
102102
>
103103
{OPEN_TO_ANY_CARDS.map(({ title, description, path, url }) => (
104104
<HomeCard

govtool/frontend/src/components/organisms/Home/Socials.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const Socials = ({ my = 4 }: { my?: number }) => {
2626

2727
return (
2828
<Box my={my} component="section" data-testid="join-discussion-section">
29-
<Typography variant="title2">
29+
<Typography variant="title">
3030
{t("home.joinDiscussion.section.title")}
3131
</Typography>
3232
<Box
@@ -36,8 +36,8 @@ export const Socials = ({ my = 4 }: { my?: number }) => {
3636
sm: "repeat(2, 1fr)",
3737
lg: "repeat(3, 1fr)",
3838
}}
39-
gap={4}
40-
mt={4}
39+
gap={3.75}
40+
mt={3.75}
4141
>
4242
{SOCIAL_CARDS.map(({ title, description, url }) => (
4343
<HomeCard

govtool/frontend/src/components/organisms/Home/UsefulLinks.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
6363

6464
return (
6565
<div>
66-
<Typography variant="title2" sx={{ mb: 4, textAlign: align }}>
66+
<Typography variant="title" sx={{ mb: 4, textAlign: align }}>
6767
{t("usefulLinks.title")}
6868
</Typography>
6969
<Box
@@ -73,8 +73,8 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
7373
sm: "repeat(2, 1fr)",
7474
lg: "repeat(4, 1fr)",
7575
}}
76-
gap={4}
77-
mt={4}
76+
gap={3.75}
77+
mt={3.75}
7878
>
7979
{Object.entries(LINKS).map(([key, { url }]) => (
8080
<Card
@@ -87,12 +87,13 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
8787
display: "flex",
8888
flexDirection: "column",
8989
gap: 1,
90+
backgroundColor: "white",
9091
}}
9192
>
92-
<Typography>
93+
<Typography component="h3" variant="titleH3">
9394
{t(`usefulLinks.${key as keyof typeof LINKS}.title`)}
9495
</Typography>
95-
<Typography variant="caption" sx={{ mb: 1 }}>
96+
<Typography variant="body" sx={{ mb: 1 }}>
9697
{t(`usefulLinks.${key as keyof typeof LINKS}.description`)}
9798
</Typography>
9899
<Link
@@ -110,7 +111,11 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
110111
},
111112
}}
112113
>
113-
<Typography color="primary" variant="body2">
114+
<Typography
115+
color="primary"
116+
variant="body2"
117+
sx={{ fontSize: "21px" }}
118+
>
114119
{t(`usefulLinks.${key as keyof typeof LINKS}.link`)}
115120
</Typography>
116121
<img

govtool/frontend/src/pages/Home.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export const Home = () => {
4747
sx={{
4848
whiteSpace: "pre-line",
4949
}}
50-
variant="body1"
50+
variant="title"
51+
component="h1"
5152
>
5253
<Trans
5354
i18nKey="hero.description"
@@ -60,7 +61,7 @@ export const Home = () => {
6061
rel="noopener noreferrer"
6162
sx={{
6263
cursor: "pointer",
63-
fontSize: 16,
64+
fontSize: 22,
6465
}}
6566
/>,
6667
]}

0 commit comments

Comments
 (0)