-
-
Notifications
You must be signed in to change notification settings - Fork 10k
/
Hero.tsx
65 lines (57 loc) · 1.36 KB
/
Hero.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use client';
import { createStyles } from 'antd-style';
import { rgba } from 'polished';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import { BRANDING_NAME } from '@/const/branding';
const useStyles = createStyles(({ css, token }) => {
return {
desc: css`
font-size: min(24px, 4vw);
font-weight: 400;
color: ${rgba(token.colorText, 0.8)};
text-align: center;
text-wrap: balance;
`,
title: css`
margin-block-end: 0;
font-size: min(56px, 7vw);
font-weight: 800;
line-height: 1;
text-align: center;
text-wrap: balance;
`,
};
});
const Hero = memo(() => {
const { styles } = useStyles();
const { t } = useTranslation('welcome');
return (
<>
<Flexbox
align={'center'}
as={'h1'}
className={styles.title}
gap={16}
horizontal
justify={'center'}
wrap={'wrap'}
>
<strong style={{ fontSize: 'min(56px, 8vw)' }}>{BRANDING_NAME}</strong>
<span>{t('slogan.title')}</span>
</Flexbox>
<Flexbox
align={'center'}
as={'h2'}
className={styles.desc}
horizontal
justify={'center'}
wrap={'wrap'}
>
{t('slogan.desc1')}
</Flexbox>
</>
);
});
export default Hero;