UNPKG

@uiw/react-native

Version:
25 lines 695 B
import React from 'react'; import PropTypes from 'prop-types'; import { StyleSheet, Text } from 'react-native'; import { useTheme } from '@shopify/restyle'; const styles = StyleSheet.create({ default: { marginBottom: 10, fontSize: 32, fontWeight: '500' } }); export default function H2(props) { const theme = useTheme(); const textColor = theme.colors.primary_text || '#ccc'; return <Text {...props} style={[styles.default, props.style, { color: textColor }]}> {props.children} </Text>; } H2.propTypes = { children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node, PropTypes.string]), style: PropTypes.any }; H2.defaultProps = {};