Skip to content

Instantly share code, notes, and snippets.

@CharlesMangwa
Last active May 9, 2017 16:11
Show Gist options
  • Save CharlesMangwa/891d1181cf819736faa319604f61e52d to your computer and use it in GitHub Desktop.
Save CharlesMangwa/891d1181cf819736faa319604f61e52d to your computer and use it in GitHub Desktop.
Auth screen sample with React Router Navigation
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