Skip to content

Commit 9a2f971

Browse files
committed
fix(#3622): apply new design system theme changes to home page
1 parent 0903942 commit 9a2f971

File tree

9 files changed

+41
-22
lines changed

9 files changed

+41
-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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ 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
},
@@ -29,7 +30,9 @@ export const HomeCard = ({ title, description, onCardClick }: Props) => (
2930
aria-label={`${title}. ${description}`}
3031
dataTestId={`home-card-${title.replace(/\s+/g, "-").toLowerCase()}`}
3132
>
32-
<Typography component="h3">{title}</Typography>
33-
<Typography variant="caption">{description}</Typography>
33+
<Typography component="h3" variant="titleH3">
34+
{title}
35+
</Typography>
36+
<Typography variant="body">{description}</Typography>
3437
</Card>
3538
);

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">
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: 10 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
@@ -89,10 +89,10 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
8989
gap: 1,
9090
}}
9191
>
92-
<Typography>
92+
<Typography component="h3" variant="titleH3">
9393
{t(`usefulLinks.${key as keyof typeof LINKS}.title`)}
9494
</Typography>
95-
<Typography variant="caption" sx={{ mb: 1 }}>
95+
<Typography variant="body" sx={{ mb: 1 }}>
9696
{t(`usefulLinks.${key as keyof typeof LINKS}.description`)}
9797
</Typography>
9898
<Link
@@ -110,7 +110,11 @@ export const UsefulLinks = ({ align = "left" }: Props) => {
110110
},
111111
}}
112112
>
113-
<Typography color="primary" variant="body2">
113+
<Typography
114+
color="primary"
115+
variant="body2"
116+
sx={{ fontSize: "21px" }}
117+
>
114118
{t(`usefulLinks.${key as keyof typeof LINKS}.link`)}
115119
</Typography>
116120
<img

govtool/frontend/src/pages/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const Home = () => {
4747
sx={{
4848
whiteSpace: "pre-line",
4949
}}
50-
variant="body1"
50+
variant="title"
5151
>
5252
<Trans
5353
i18nKey="hero.description"
@@ -60,7 +60,7 @@ export const Home = () => {
6060
rel="noopener noreferrer"
6161
sx={{
6262
cursor: "pointer",
63-
fontSize: 16,
63+
fontSize: 22,
6464
}}
6565
/>,
6666
]}

0 commit comments

Comments
 (0)