Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. type Props = {
  2. children?: React.Node,
  3. onPress?: Function,
  4. style?: StyleSheet.Styles,
  5. textStyle?: StyleSheet.Styles,
  6. }
  7.  
  8. const AppText = ({ children, onPress, style, textStyle }: Props) => {
  9. if (!children) {
  10. return null
  11. }
  12.  
  13. return (
  14. <View style={{ ...styles.appTextView, ...style }}>
  15. <Text onPress={onPress} style={{ ...styles.textLabel, ...textStyle }}>
  16. {children}
  17. </Text>
  18. </View>
  19. )
  20. }
  21.  
  22. AppText.defaultProps = {
  23. children: null,
  24. onPress: () => {},
  25. style: {},
  26. textStyle: {},
  27. }
  28.  
  29. <AppText
  30. onPress={() => navigation.goBack()}
  31. style={styles.cancel}
  32. textStyle={styles.cancelText}
  33. >
  34. Retour
  35. </AppText>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement