Use react-navigation to navigate away from home screen

This commit is contained in:
Julia Friesel
2018-05-30 13:27:21 +02:00
parent c0fb909324
commit 63b8049d32
3 changed files with 148 additions and 8 deletions
+10 -7
View File
@@ -5,22 +5,25 @@ import {
Text
} from 'react-native'
import styles from './styles'
import { createStackNavigator } from 'react-navigation'
import temperatureList from './List'
export default class home extends Component {
class home extends Component {
constructor(props) {
super(props)
}
render() {
const navigate = this.props.navigation.navigate
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome! Today is day 6 of your current cycle</Text>
<Button
onPress={goToSymptomEdit}
onPress={() => navigate('temperatureList')}
title="Edit symptoms for today">
</Button>
<Button
onPress={goToCalendar}
onPress={() => {}}
title="Go to calendar">
</Button>
</View>
@@ -28,7 +31,7 @@ export default class home extends Component {
}
}
function goToSymptomEdit () {
}
function goToCalendar () {}
export default createStackNavigator({
home: { screen: home },
temperatureList: { screen: temperatureList }
})