import * as React from 'react' import { Headline, Paragraph, Subheading, Caption, withTheme, Text, } from 'react-native-paper' function MyText(props) { const { type, size, children, bold } = props let { color, theme, style } = props const { colors } = theme if (type) { color = colors[type] } if (color) { theme = { ...theme, colors: { ...theme.colors, text: color, }, } } if (bold) { style = { ...style, fontWeight: 'bold', } } switch (size) { case 'h1': // 24 return ( {children} ) case 's1': // 16 return ( {children} ) case 'c1': // 12 return ( {children} ) case 'c2': // 10 return ( {children} ) default: // 14 return {children} } } export default withTheme(MyText)