Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Props = {
- children?: React.Node,
- onPress?: Function,
- style?: StyleSheet.Styles,
- textStyle?: StyleSheet.Styles,
- }
- const AppText = ({ children, onPress, style, textStyle }: Props) => {
- if (!children) {
- return null
- }
- return (
- <View style={{ ...styles.appTextView, ...style }}>
- <Text onPress={onPress} style={{ ...styles.textLabel, ...textStyle }}>
- {children}
- </Text>
- </View>
- )
- }
- AppText.defaultProps = {
- children: null,
- onPress: () => {},
- style: {},
- textStyle: {},
- }
- <AppText
- onPress={() => navigation.goBack()}
- style={styles.cancel}
- textStyle={styles.cancelText}
- >
- Retour
- </AppText>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement