import React from 'react'; import { Platform, StyleSheet, Text as NativeText, TextProps, } from 'react-native'; import { palette } from '../theme/palette'; const normalize = (size: number) => size; export interface _TextProps extends TextProps { h1?: boolean; h2?: boolean; h3?: boolean; h4?: boolean; h5?: boolean; t1?: boolean; t2?: boolean; tBold?: boolean; t3?: boolean; t4?: boolean; t5?: boolean; color?: string; verticalCenter?: boolean; tx?: string; isCenter?: boolean; paragraph?: boolean; } export const Text = React.forwardRef(function Text( { style = {}, h1 = false, h2 = false, h3 = false, h4 = false, h5 = false, t1 = false, t2 = false, tBold = false, t3 = false, t4 = false, t5 = false, children = '', tx = '', verticalCenter = false, color = palette.G7(1), isCenter, paragraph, ...rest }, ref, ) { return ( {tx || children} ); }); const bold = Platform.OS === 'ios' ? '600' : 'bold'; const styles = StyleSheet.create({ d1: {}, d2: {}, enTBold: { fontWeight: bold, }, h1: { fontWeight: bold, }, h2: { fontWeight: bold, }, h3: { fontWeight: bold }, h4: { fontWeight: bold }, h5: { fontWeight: bold }, text: { fontSize: normalize(14), }, textCenter: { alignSelf: 'center', }, }); Text.displayName = 'Text';