Skip to content

Instantly share code, notes, and snippets.

@Yassir4
Created August 4, 2019 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yassir4/41d6f4fe201b63be36899adff93a8f4d to your computer and use it in GitHub Desktop.
Save Yassir4/41d6f4fe201b63be36899adff93a8f4d to your computer and use it in GitHub Desktop.
ModalScreen/index.js
// ModalScreen/index.js
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
class ModalScreen extends Component {
constructor(props) {
super(props);
Navigation.events().bindComponent(this);
}
navigationButtonPressed({buttonId}) {
if (buttonId === 'leftButton') {
Navigation.dismissModal(this.props.componentId);
}
}
render() {
const {text} = this.props;
return (
<View style={styles.container}>
<Text style={styles.headerText}>{text}</Text>
</View>
);
}
}
export default ModalScreen;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment