|
| 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