Skip to content

Commit 9cfea90

Browse files
fix: unhide hidden h1 title (#936)
* fix: Update development server port to 3000. * fix: Add title display and update styles for the Hero CMP. * fix: Revert development server port.
1 parent 3926df9 commit 9cfea90

4 files changed

Lines changed: 36 additions & 14 deletions

File tree

src/features/common/components/hero/hero.component.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import { BoxComponent } from "@/features/common/components/box/box.component";
55
import styles from "./hero.module.scss";
66
import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model";
77
import Link from "next/link";
8+
import { clsx } from "clsx";
9+
import { getLocalizedSecondaryFont } from "@/libs/theme/fonts";
810

911
interface HeroComponentProps {
1012
languageCode: string;
13+
title: string;
1114
dictionary: HomeDictionaryModel["info"];
1215
}
1316

14-
export const HeroComponent: React.FC<HeroComponentProps> = ({ dictionary }) => {
17+
export const HeroComponent: React.FC<HeroComponentProps> = ({
18+
languageCode,
19+
title,
20+
dictionary,
21+
}) => {
1522
const description = dictionary.description.split(
1623
dictionary.resources.spec.name
1724
);
@@ -23,6 +30,11 @@ export const HeroComponent: React.FC<HeroComponentProps> = ({ dictionary }) => {
2330
wrapperClassName={styles.wrapper}
2431
>
2532
<div className={styles.hero}>
33+
<h1
34+
className={clsx(styles.title, getLocalizedSecondaryFont(languageCode))}
35+
>
36+
{title}
37+
</h1>
2638
<p className={styles.modal}>
2739
<span className={styles.modal__text}>
2840
{

src/features/common/components/hero/hero.module.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
.hero {
2323
z-index: 1;
2424
display: flex;
25+
flex-direction: column;
2526
justify-content: center;
27+
align-items: center;
2628
width: 100%;
2729
padding: 1.25rem 0;
2830
text-align: center;
@@ -32,6 +34,26 @@
3234
}
3335
}
3436

37+
.title {
38+
width: 100%;
39+
max-width: 42rem;
40+
margin: 0;
41+
color: var(--color_fg_bold);
42+
font-size: 2rem;
43+
line-height: 1.15;
44+
font-weight: 500;
45+
letter-spacing: -0.8px;
46+
text-wrap-style: balance;
47+
48+
@media #{$breakpoint-dimension-xs} {
49+
font-size: 2.5rem;
50+
}
51+
52+
@media #{$breakpoint-dimension-sm} {
53+
font-size: 3rem;
54+
}
55+
}
56+
3557
.modal {
3658
max-width: 608px;
3759
padding: 2.5rem 0;

src/features/home/components/home-page/home-page.component.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import styles from "./home-page.module.scss"
32
import { HeroComponent } from "@/features/common/components/hero/hero.component";
43
import {
54
getHomeDictionary,
@@ -126,9 +125,9 @@ export const HomePageComponent: React.FC<HomePageComponentProps> = ({
126125
},
127126
]}
128127
/>
129-
<h1 className={styles.visually_hidden}>{homeDictionary.metadata.title}</h1>
130128
<HeroComponent
131129
languageCode={languageCode}
130+
title={homeDictionary.hero.title}
132131
dictionary={homeDictionary.info}
133132
/>
134133
<DebuggerWidgetComponent

src/features/home/components/home-page/home-page.module.scss

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

0 commit comments

Comments
 (0)