Skip to content

Commit 131eefa

Browse files
rvveberAntoLC
authored andcommitted
🔨(frontend) encapsulate title component
in order to modularize in the future the title component is encapsulated.
1 parent b4e639c commit 131eefa

File tree

3 files changed

+38
-25
lines changed

3 files changed

+38
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to
99

1010
## [Unreleased]
1111

12+
## Changed
13+
14+
- 🔨(frontend) encapsulated title to its own component #474
15+
1216

1317
## [1.8.2] - 2024-11-28
1418

src/frontend/apps/impress/src/features/header/components/Header.tsx

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Image from 'next/image';
22
import React from 'react';
33
import { useTranslation } from 'react-i18next';
44

5-
import { Box, StyledLink, Text } from '@/components/';
5+
import { Box, StyledLink } from '@/components/';
66
import { ButtonLogin } from '@/core/auth';
77
import { LanguagePicker } from '@/features/language';
88
import { useResponsiveStore } from '@/stores';
@@ -11,6 +11,7 @@ import { default as IconDocs } from '../assets/icon-docs.svg?url';
1111

1212
import { DropdownMenu } from './DropdownMenu';
1313
import { LaGaufre } from './LaGaufre';
14+
import Title from './Title/Title';
1415

1516
export const Header = () => {
1617
const { t } = useTranslation();
@@ -45,30 +46,7 @@ export const Header = () => {
4546
$margin={{ top: 'auto' }}
4647
>
4748
<Image priority src={IconDocs} alt={t('Docs Logo')} width={25} />
48-
<Text
49-
$padding="2px 3px"
50-
$size="8px"
51-
$background="#368bd6"
52-
$color="white"
53-
$position="absolute"
54-
$radius="5px"
55-
$css={`
56-
bottom: 13px;
57-
right: -17px;
58-
`}
59-
>
60-
BETA
61-
</Text>
62-
<Text
63-
$margin="none"
64-
as="h2"
65-
$color="#000091"
66-
$zIndex={1}
67-
$size="1.30rem"
68-
$css="font-family: 'Marianne'"
69-
>
70-
{t('Docs')}
71-
</Text>
49+
<Title />
7250
</Box>
7351
</StyledLink>
7452
</Box>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { useTranslation } from 'react-i18next';
2+
3+
import { Text } from '@/components/';
4+
5+
const Title = () => {
6+
const { t } = useTranslation();
7+
8+
return (
9+
<>
10+
<Text
11+
$padding="2px 3px"
12+
$size="8px"
13+
$background="#368bd6"
14+
$color="white"
15+
$position="absolute"
16+
$radius="5px"
17+
$css={`
18+
bottom: 13px;
19+
right: -17px;
20+
`}
21+
>
22+
BETA
23+
</Text>
24+
<Text $margin="none" as="h2" $color="#000091" $zIndex={1} $size="1.30rem">
25+
{t('Docs')}
26+
</Text>
27+
</>
28+
);
29+
};
30+
31+
export default Title;

0 commit comments

Comments
 (0)