Skip to content
Snippets Groups Projects
Commit c744520b authored by Julia Friesel's avatar Julia Friesel
Browse files

Fix menu bug

parent d731bbbe
No related branches found
No related tags found
No related merge requests found
import React, { Component } from 'react'
import {
View,
Text
Text,
TouchableOpacity
} from 'react-native'
import styles, { iconStyles } from '../styles'
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
export default class Menu extends Component {
makeMenuItem({ title, icon, componentName }) {
return (
<TouchableOpacity
onPress={() => this.props.navigate(componentName)}
style={{ alignItems: 'center' }}
>
<Icon name={icon} {...iconStyles.menuIcon} />
<Text style={styles.menuText}>
{title}
</Text>
</TouchableOpacity>
)
}
render() {
return (
this.props.symptomView ?
......@@ -19,22 +33,8 @@ export default class Menu extends Component {
{title: 'Chart', icon: 'chart-line', componentName: 'Chart'},
{title: 'Stats', icon: 'chart-pie', componentName: 'Stats'},
{title: 'Settings', icon: 'settings', componentName: 'Settings'},
].map(makeMenuItem)}
].map(this.makeMenuItem.bind(this))}
</View >
)
}
}
function makeMenuItem({title, icon, componentName}) {
return (
<View style={{alignItems: 'center'}}>
<Icon name={icon} {...iconStyles.menuIcon}/>
<Text
style={styles.menuText}
onPress={() => this.props.navigate(componentName)}
>
{title}
</Text>
</View>
)
}
\ No newline at end of file
......@@ -9,7 +9,6 @@ import {
import Share from 'react-native-share'
import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker'
import rnfs from 'react-native-fs'
import Header from './header'
import styles from '../styles/index'
import { settings as labels } from './labels'
import getDataAsCsvDataUri from '../lib/import-export/export-to-csv'
......@@ -19,7 +18,6 @@ export default class Settings extends Component {
render() {
return (
<ScrollView>
<Header title='Settings'/>
<View style={styles.homeButtons}>
<View style={styles.homeButton}>
<Button
......
......@@ -16,7 +16,6 @@ export default class Stats extends Component {
const statsText = determineStatsText(allMensesStarts)
return (
<ScrollView>
<Header title='Statistics' />
<View>
<Text style={styles.stats}>{statsText}</Text>
</View>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment