robcalcroft / react-native-in-app-notification

:bell: Customisable in-app notification component for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DefaultNotificationBody.js would be better if the changes are done

pencilcheck opened this issue · comments

  1. onPress is not at the outmost layer that overwrites onClose
  2. Could be more clear that onClose is a predefined function, not a default value that you can pass into the custom component props.
  <TouchableHighlight
    style={defaultStyles.root}
    activeOpacity={0.3}
    underlayColor="transparent"
  >
    <View style={[defaultStyles.container, { paddingBottom: title && message ? 10 : 0 }]}>
      <TouchableHighlight
        style={defaultStyles.root}
        activeOpacity={0.3}
        underlayColor="transparent"
        onPress={() => {
          onPress()
          onClose()
        }}
      >
        <View>
          {title ? <Text style={[defaultStyles.text, defaultStyles.bold]}>{title}</Text> : null}
          {message ? <Text style={defaultStyles.text}>{message}</Text> : null}
        </View>
      </TouchableHighlight>
      <View>
        <TouchableHighlight activeOpacity={0.3} underlayColor="transparent" onPress={onClose}>
          <Text>Close</Text>
        </TouchableHighlight>
      </View>
    </View>
  </TouchableHighlight>

@pencilcheck hey thanks for submitting this. If you want to open a pull request with these changes I'll happily take a look at them 😄

@pencilcheck take a look at #4 and see if those changes fix some of the issues you were having

Thanks for mentioning me, however right now I don't have time to look and we are planning to going back and use this again at until some later timeline. Appreciated it though!

I'm closing this as there's been no activity. Please re-open if you'd like to discuss more 😄