[enter image description here](https://i.stack.imgur.com/pHyi2.png)

```html
import React from 'react';
import { StyleSheet, Text, View,TouchableOpacity, AppRegistry} from 'react-native';
import { StackNavigator } from 'react-navigation';
import Login from './screens/Login';

export default class App extends React.Component {
  /*
  static navigationOptions = {
    title: 'Home',
    headerstyle: {
      backgroundColor: 'powderblue',
    },
      headerTitleStyle: {
        color: '#FFFFFF'
      }
  };
  */

  render() {
    const {navigate} = this.props.navigation;
    return (
      <View 
          style={styles.container} >   

          <View style={styles.boxContainer}>
            <View style = {[styles.boxContainer, styles.boxOne]}>
              <Text style={styles.paragraph}>Tido</Text>
            </View>

              <View style={styles.boxContainerToggle}>
                <TouchableOpacity style={[styles.boxContainer, styles.boxTwo]} onPress={() => this.props.navigate('Login')}>
                    <Text style={styles.paragraph}>Login</Text>
                </TouchableOpacity>

                <TouchableOpacity style={[styles.boxContainer, styles.boxThree]}>
                    <Text style={styles.paragraph}>Sign Up</Text>
                </TouchableOpacity>
              </View>          
          </View>

      </View>

    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'column'
  },
  boxContainer: {
    flex: 1, // 1:3
    alignItems: 'center',
    justifyContent: 'center',

  },
  boxContainerToggle: {
    flex: 1, 
    flexDirection: 'row'
  },
  boxOne: {
    flex: 6, // 5:6
    backgroundColor: 'white',
    justifyContent: 'space-around',
    alignItems: 'center',

  },
  boxTwo: {
    flex: 1, // 1:6
    backgroundColor: 'powderblue',
    flexDirection: 'row',
    width: '50%',
    height: '100%'

  },
  boxThree: {
    flex: 1, // 1:6
    flexDirection: 'row',
    backgroundColor: 'skyblue',
    width: '50%',
    height: '100%'
  },
  paragraph: {
    margin: 24,
    fontSize: 27,
    fontWeight: 'bold',
    textAlign: 'center',
    color: '#34495e',
  }, 
});

const appScreens = StackNavigator({
  Index: { screen: App },
  Login: { screen: Login }
})

AppRegistry.registerComponent('tido', () => appScreens);
```

```html
import React from 'react';
import {StyleSheet, View, TextInput, TouchableOpacity} from 'react-native';

export default class Login extends React.Component {
    /*
    static navigationOptions = {
        title: 'Home',
        headerstyle: {
          backgroundColor: 'powderblue',
        },
          headerTitleStyle: {
            color: '#FFFFFF'
          }
      };
      */

    constructor(props) {
        super(props)
    }

    render(){
        return(
            <View style={styles.container}>

                <View style={styles.boxContainer}>
                    <View style = {[styles.boxContainer, styles.boxOne]}>
                        <TextInput 
                            style={styles.inputBox} 
                            placeholder="username,email or phone"
                            placeholderTextColor="#00000">
                        </TextInput>

                        <TextInput 
                            style={styles.inputBox}
                            placeholder="password"
                            placeholderTextColor="#00000">
                        </TextInput>
                    </View>

                     <View style={styles.boxContainerToggle}>
                         <TouchableOpacity 
                            style={[styles.boxContainer, styles.boxTwo]}>

                        </TouchableOpacity>
                    </View>          
                </View>   
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        flexDirection: 'column'
    },
    boxContainer: {
        flex: 1, // 1:3
        alignItems: 'center',
        justifyContent: 'center',

      },
      boxContainerToggle: {
        flex: 1, 
        flexDirection: 'row'
      },
      boxOne: {
        flex: 6, // 5:6
        backgroundColor: 'white',
        justifyContent: 'space-around',
        alignItems: 'center',

      },
      boxTwo: {
        flex: 1, // 1:6
        backgroundColor: '#252525',
        flexDirection: 'row',
        width: '50%',
        height: '100%'

      },
      inputBox: {
          height: 40,
          marginBottom: 20,
          color: '#000000',
          paddingHorizontal: 10,

      },      
      paragraph: {
        margin: 24,
        fontSize: 27,
        fontWeight: 'bold',
        textAlign: 'center',
        color: '#34495e',
      },
});
```

I get this error hen I run my code. I took off const {navigate} = this.props.navigation; and used onPress={() => this.props.navigate('Login')}
but it gives me another error TypeError: undefined not an object(evaluating '\_this2.props.navigation.navigate'}

So I want to fix my code. Any Help ?