Files
drip/components/app-text.js
T
2020-03-11 20:19:45 +00:00

27 lines
658 B
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import { Text } from 'react-native'
import styles from "../styles"
import Link from './link'
export default function AppText({ children, onPress, numberOfLines, style}) {
// we parse for links in case the text contains any
return (
<Link>
<Text style={[styles.appText, style]}
onPress={onPress}
numberOfLines={numberOfLines}
>
{children}
</Text>
</Link>
)
}
AppText.propTypes = {
children: PropTypes.node,
onPress: PropTypes.func,
numberOfLines: PropTypes.number,
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
}