Typography.tsx32 lines · main
| 1 | import React from 'react' |
| 2 | |
| 3 | import Link from './Link' |
| 4 | import Text from './Text' |
| 5 | import Title from './Title' |
| 6 | // @ts-ignore |
| 7 | import TypographyStyles from './Typography.module.css' |
| 8 | |
| 9 | function Typography({ children, tag = 'div', style }: any) { |
| 10 | // let classes = [ |
| 11 | // TypographyStyles['sbui-typography'], |
| 12 | // TypographyStyles['sbui-typography-container'], |
| 13 | // ] |
| 14 | // if (className) { |
| 15 | // classes.push(className) |
| 16 | // } |
| 17 | let CustomTag: any = `${tag}` |
| 18 | return ( |
| 19 | <CustomTag |
| 20 | style={style} |
| 21 | // className={classes.join(' ')} |
| 22 | > |
| 23 | {children} |
| 24 | </CustomTag> |
| 25 | ) |
| 26 | } |
| 27 | |
| 28 | Typography.Title = Title |
| 29 | Typography.Text = Text |
| 30 | Typography.Link = Link |
| 31 | |
| 32 | export default Typography |