Last active
May 9, 2017 16:11
-
-
Save CharlesMangwa/891d1181cf819736faa319604f61e52d to your computer and use it in GitHub Desktop.
Auth screen sample with React Router Navigation
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 from 'react' | |
import { Image, View } from 'react-native' | |
import { Card, Navigation } from 'react-router-navigation' | |
import { Connection, Inscription, Main } from '@Auth/modules' | |
import { BackButton } from '@components' | |
import logo from '@assets/images/logo.png' | |
import styles from './styles' | |
const Auth = ({ history }) => ( | |
<View styles={styles.container}> | |
<Image source={logo} style={styles.logo} /> | |
<Navigation navBarStyle={styles.navBar}> | |
<Card | |
exact path="/auth" | |
component={Main} | |
/> | |
<Card | |
exact path="/auth/connection" | |
component={Connection} | |
backButtonTitle="Back" | |
renderLeftButton={() => ( | |
<BackButton onPress={() => history.goBack()} /> | |
)} | |
/> | |
<Card | |
exact path="/auth/inscription" | |
component={Inscription} | |
backButtonTitle="Back" | |
renderLeftButton={() => ( | |
<BackButton onPress={() => history.goBack()} /> | |
)} | |
/> | |
</Navigation> | |
</View> | |
) | |
export default Root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment