Created
August 12, 2017 23:43
-
-
Save LaloHao/1304a8c8c23128213f199a13059182f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
Text, | |
TouchableOpacity | |
} from 'react-native'; | |
import ModalTester from './ModalTester.js'; | |
export default class App extends Component { | |
render () { | |
return ( | |
<View style={{ flex: 1 }}> | |
<TouchableOpacity onPress={() => this.Modal.showModal()}> | |
<Text style={{color: 'black'}}>Mostrar</Text> | |
</TouchableOpacity> | |
<ModalTester ref={ref => this.Modal = ref}> | |
<TouchableOpacity onPress={() => this.Modal.hideModal()}> | |
<Text style={{color: 'black'}}>Esconder</Text> | |
</TouchableOpacity> | |
</ModalTester> | |
</View> | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Text, View, StyleSheet } from 'react-native'; | |
import Modal from 'react-native-modal'; | |
export default class ModalTester extends Component { | |
state = { | |
isModalVisible: false | |
} | |
showModal = () => this.setState({ isModalVisible: true }) | |
hideModal = () => this.setState({ isModalVisible: false }) | |
render () { | |
return ( | |
<View style={{ flex: 1 }}> | |
<Modal isVisible={this.state.isModalVisible}> | |
{this.props.children} | |
</Modal> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import React, { Component } from 'react';
import { Image, StyleSheet, } from 'react-native';
import { Header, Container, Content, View, Card, CardItem, Icon, Thumbnail, Text, Button, Left, Body } from 'native-base';
import ModalTester from './../Cold/cold.js';
import Modal from 'react-native-modal';
export default class Form extends Component {
}