Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 55a778d

Browse files
konstantinosG-derivhabib-derivKonstantinos-Gk
committed
Konstantinos / Reusable title (#4087)
* habib/Add trade types component initial (#4076) * chore: add component initial * chore: update full width container for product pages * Habib/fix vercel issue rebranding (#4084) * chore: update package-lock * chore: update package * Revert "Habib/fix vercel issue rebranding (#4084)" (#4085) This reverts commit 7648e09. * feat: add title and subtitle component * fix: change name Co-authored-by: Habib Deriv <[email protected]> Co-authored-by: Konstantinos-Gk <[email protected]>
1 parent 6115f4e commit 55a778d

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import React from 'react'
2+
import { TString } from 'types/generics'
3+
import { Localize } from 'components/localization'
4+
import { Flex } from 'components/containers'
5+
6+
type CommonHeaderSectionProps = {
7+
title?: TString
8+
subtitle?: TString
9+
padding?: string
10+
bgcolor?: string
11+
title_font_size?: string
12+
subtitle_font_size?: string
13+
color?: string
14+
text_color?: string
15+
font_weight?: string
16+
font_style?: string
17+
margin?: string
18+
title_text_color?: string
19+
subtitle_text_color?: string
20+
width?: string
21+
height?: string
22+
align_title?: string
23+
align_subtitle?: string
24+
}
25+
26+
const CommonHeaderSection = ({
27+
title,
28+
subtitle,
29+
padding,
30+
margin,
31+
bgcolor,
32+
color,
33+
title_text_color,
34+
subtitle_text_color,
35+
title_font_size,
36+
subtitle_font_size,
37+
width,
38+
height,
39+
align_title,
40+
align_subtitle,
41+
}: CommonHeaderSectionProps) => {
42+
return (
43+
<div
44+
style={{
45+
backgroundColor: bgcolor,
46+
color: color,
47+
padding: padding,
48+
width: width,
49+
height: height,
50+
}}
51+
>
52+
<Flex direction="column">
53+
<h1
54+
style={{
55+
color: title_text_color,
56+
fontSize: title_font_size,
57+
fontFamily: 'Ubuntu',
58+
fontWeight: 'bold',
59+
margin: margin,
60+
textAlign: align_title,
61+
}}
62+
>
63+
<Localize translate_text={title} />
64+
</h1>
65+
<p
66+
style={{
67+
color: subtitle_text_color,
68+
fontSize: subtitle_font_size,
69+
fontFamily: 'IBM Plex Sans',
70+
fontWeight: 'normal',
71+
margin: margin,
72+
textAlign: align_subtitle,
73+
}}
74+
>
75+
<Localize translate_text={subtitle} />
76+
</p>
77+
</Flex>
78+
</div>
79+
)
80+
}
81+
82+
export default CommonHeaderSection

0 commit comments

Comments
 (0)