react-native-material-ripple
react-native-material-ripple copied to clipboard
Ripple is not working inside function call.
Here is my code.
<View style={{ backgroundColor: 'blue', width: '100%', height: 900, top: 0 }}>
{this.state.ImageViewVisible == false ?
<View style={{ backgroundColor: 'yellow', top: 50, height: 180 }}>
<IconView>
<UploadIconSvg style={{ left: 120 }} />
<Text style={{ fontSize: 20, color: '#96A9C3', fontFamily: 'avenirBook', lineHeight: 28, textAlign: 'center', top: 10 }}>Upload your custom {'\n'}icon</Text>
</IconView>
<Ripple onPress={() => this._pickImage()} style={styles.Btn}>
<Text style={{ fontSize: 15, color: '#ffff', fontFamily: 'avenirMedium', textAlign: 'center' }}>Upload Icon</Text>
</Ripple>
</View>
:
<View style={{ backgroundColor: 'red', top: 50, height: 180 }}>
<ImageView>
{image && <Img source={{ uri: image }} />}
<Ripple onPress={() => this.onRemoveImg()} rippleOpacity={0} style={styles.ImgClose}>
<Ionicons name="ios-close-circle" size={30} color="black" />
</Ripple>
</ImageView>
<Ripple onPress={() => console.log('tapped icon')} style={styles.Btn}>
<Text style={{ fontSize: 15, color: '#ffff', fontFamily: 'avenirMedium', textAlign: 'center' }}>Set Icon</Text>
</Ripple>
</View>
}
</View>
Help much appreciated pls...
You can use function below put onLongPress const onLongPressHandle = () => { if (typeof onLongPress === 'function') { onLongPress(); } else { onPress(); } };