Start replacing navigator
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React, { Component } from 'react'
|
||||
import { View } from 'react-native'
|
||||
import { CalendarList } from 'react-native-calendars'
|
||||
import Header from './header'
|
||||
import * as styles from '../styles'
|
||||
import { getOrCreateCycleDay, bleedingDaysSortedByDate } from '../db'
|
||||
|
||||
@@ -11,9 +10,11 @@ export default class CalendarView extends Component {
|
||||
this.state = {
|
||||
bleedingDaysInCalFormat: toCalFormat(bleedingDaysSortedByDate)
|
||||
}
|
||||
console.log(Object.keys(this.state.bleedingDaysInCalFormat))
|
||||
|
||||
this.setStateWithCalFormattedDays = (function (CalendarComponent) {
|
||||
return function() {
|
||||
return function(_, changes) {
|
||||
if (Object.values(changes).every(x => x && !x.length)) return
|
||||
CalendarComponent.setState({
|
||||
bleedingDaysInCalFormat: toCalFormat(bleedingDaysSortedByDate)
|
||||
})
|
||||
@@ -34,9 +35,9 @@ export default class CalendarView extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log('cal render')
|
||||
return (
|
||||
<View>
|
||||
<Header title='Calendar' />
|
||||
<View style={styles.container}>
|
||||
<CalendarList
|
||||
onDayPress={this.passDateToDayView.bind(this)}
|
||||
|
||||
@@ -49,7 +49,6 @@ export default class Home extends Component {
|
||||
render() {
|
||||
return (
|
||||
<ScrollView>
|
||||
<Header title='Home'/>
|
||||
<Text style={styles.welcome}>{this.state.welcomeText}</Text>
|
||||
<View style={styles.homeButtons}>
|
||||
<View style={styles.homeButton}>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react'
|
||||
import {
|
||||
View,
|
||||
Text
|
||||
} from 'react-native'
|
||||
import styles, { iconStyles } from '../styles'
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
|
||||
|
||||
export default class Menu extends Component {
|
||||
render() {
|
||||
return (
|
||||
this.props.symptomView ?
|
||||
placeActionButtons()
|
||||
:
|
||||
<View style={styles.menu}>
|
||||
<Text
|
||||
style={styles.dateHeader}
|
||||
onPress={() => this.props.navigate('Calendar')}
|
||||
>
|
||||
{'Calendar'}
|
||||
</Text>
|
||||
<Text
|
||||
style={styles.dateHeader}
|
||||
onPress={() => this.props.navigate('Settings')}
|
||||
>
|
||||
{'Settings'}
|
||||
</Text>
|
||||
</View >
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function placeActionButtons() {}
|
||||
Reference in New Issue
Block a user