Simplify home screen markup

This commit is contained in:
Julia Friesel
2018-07-15 22:35:33 +02:00
parent 0c92c85baf
commit 9eb1ad6af1
+5 -11
View File
@@ -5,7 +5,7 @@ import {
Text Text
} from 'react-native' } from 'react-native'
import { LocalDate } from 'js-joda' import { LocalDate } from 'js-joda'
import styles from '../styles/index' import styles from '../styles'
import cycleDayModule from '../lib/get-cycle-day-number' import cycleDayModule from '../lib/get-cycle-day-number'
import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from '../db' import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from '../db'
@@ -46,39 +46,33 @@ export default class Home extends Component {
render() { render() {
const navigate = this.props.navigation.navigate const navigate = this.props.navigation.navigate
return ( return (
<View style={ styles.homeContainerView }>
<View style={{flex: 2}}>
<View> <View>
<Text style={styles.welcome}>{this.state.welcomeText}</Text> <Text style={styles.welcome}>{this.state.welcomeText}</Text>
</View> <View style={styles.homeButtons}>
</View>
<View style={ styles.homeButtonsView}>
<View>
<Button <Button
onPress={() => this.passTodayToDayView()} onPress={() => this.passTodayToDayView()}
title="Edit symptoms for today"> title="Edit symptoms for today">
</Button> </Button>
</View> </View>
<View> <View style={styles.homeButton}>
<Button <Button
onPress={() => navigate('calendar')} onPress={() => navigate('calendar')}
title="Go to calendar"> title="Go to calendar">
</Button> </Button>
</View> </View>
<View> <View style={styles.homeButton}>
<Button <Button
onPress={() => navigate('chart')} onPress={() => navigate('chart')}
title="Go to chart"> title="Go to chart">
</Button> </Button>
</View> </View>
<View> <View style={styles.homeButton}>
<Button <Button
onPress={() => deleteAll()} onPress={() => deleteAll()}
title="delete everything"> title="delete everything">
</Button> </Button>
</View> </View>
</View> </View>
</View>
) )
} }
} }