123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import React, {
- Component,
- Text,
- View,
- ScrollView,
- TouchableOpacity,
- StyleSheet,
- AlertIOS
- } from 'react-native';
-
- export default class SideMenu extends Component {
- constructor(props) {
- super(props);
- }
- render() {
- return (
- <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
-
- <Text style={styles.title}>Side Menu</Text>
-
- <TouchableOpacity onPress={ this.onReplaceTab2Press.bind(this) }>
- <Text style={styles.button}>Replace Tab#2 Root</Text>
- </TouchableOpacity>
-
- <TouchableOpacity onPress={ this.onModalPress.bind(this) }>
- <Text style={styles.button}>Show Modal Screen</Text>
- </TouchableOpacity>
-
- </View>
- );
- }
- onReplaceTab2Press() {
- this.props.navigator.toggleDrawer({
- to: 'closed',
- side: 'left',
- animated: true
- });
- this.props.navigator.handleDeepLink({
- link: "tab2/example.PushedScreen"
- });
- }
- onModalPress() {
- this.props.navigator.showModal({
- title: "Modal",
- screen: "example.ModalScreen"
- });
- }
- }
-
- const styles = StyleSheet.create({
- title: {
- textAlign: 'center',
- fontSize: 18,
- marginBottom: 10,
- marginTop:10,
- fontWeight: '500'
- },
- button: {
- textAlign: 'center',
- fontSize: 18,
- marginBottom: 10,
- marginTop:10,
- color: 'blue'
- }
- });
|