Fix menu bug
This commit is contained in:
+16
-16
@@ -1,12 +1,26 @@
|
||||
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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user