0.0.2 • Published 5 years ago
modal-general v0.0.2
General Modal
General Modal is modal for react-native
Installation
Use the package manager npm to install general-modal.
npm -i modal-general
Usage
import React from 'react';
import {
View,
Text,
TouchableOpacity,
} from 'react-native';
import { ModalCenter } from 'modal-general';
export default class App extends.Component
{
state ={
showModal :false
}
onClose(v){
console.log(v)
}
render(){
return(
<View>
<TouchableOpacity
onPress={()=>this.setState({showModal:true})}>
<Text>Show Modal</Text>
</TouchableOpacity>
<ModalCenter
show={this.state.showModal}
title="Your title here"
confirm={false}
content="Message body"
onAction={(res) => this.onClose(res)}/>
</View>
)
}
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.