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

Rename screen in navigtor

parent be0b9ba0
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import { createStackNavigator } from 'react-navigation' ...@@ -2,7 +2,7 @@ import { createStackNavigator } from 'react-navigation'
import Home from './home' import Home from './home'
import Calendar from './calendar' import Calendar from './calendar'
import Day from './cycle-day' import CycleDay from './cycle-day'
// this is until react native fixes this bug, see https://github.com/facebook/react-native/issues/18868#issuecomment-382671739 // this is until react native fixes this bug, see https://github.com/facebook/react-native/issues/18868#issuecomment-382671739
import { YellowBox } from 'react-native' import { YellowBox } from 'react-native'
...@@ -11,5 +11,5 @@ YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated']) ...@@ -11,5 +11,5 @@ YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated'])
export default createStackNavigator({ export default createStackNavigator({
home: { screen: Home }, home: { screen: Home },
calendar: { screen: Calendar }, calendar: { screen: Calendar },
day: { screen: Day } cycleDay: { screen: CycleDay }
}) })
...@@ -14,7 +14,7 @@ export default class Bleeding extends Component { ...@@ -14,7 +14,7 @@ export default class Bleeding extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.cycleDay = props.cycleDay this.cycleDay = props.cycleDay
this.showView = props.bringIntoView this.showView = props.showView
let bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value let bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value
if (! (typeof bleedingValue === 'number') ){ if (! (typeof bleedingValue === 'number') ){
bleedingValue = -1 bleedingValue = -1
......
...@@ -19,7 +19,7 @@ export default class DatePickView extends Component { ...@@ -19,7 +19,7 @@ export default class DatePickView extends Component {
passDateToDayView(result) { passDateToDayView(result) {
const cycleDay = getOrCreateCycleDay(result.dateString) const cycleDay = getOrCreateCycleDay(result.dateString)
const navigate = this.props.navigation.navigate const navigate = this.props.navigation.navigate
navigate('day', { cycleDay }) navigate('cycleDay', { cycleDay })
} }
render() { render() {
......
...@@ -15,7 +15,7 @@ export default class DayView extends Component { ...@@ -15,7 +15,7 @@ export default class DayView extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.cycleDay = props.cycleDay this.cycleDay = props.cycleDay
this.showView = props.bringIntoView this.showView = props.showView
bleedingDaysSortedByDate.addListener(setStateWithCurrentCycleDayNumber.bind(this)) bleedingDaysSortedByDate.addListener(setStateWithCurrentCycleDayNumber.bind(this))
} }
......
...@@ -33,9 +33,9 @@ export default class Day extends Component { ...@@ -33,9 +33,9 @@ export default class Day extends Component {
<Text style={styles.welcome}>{formatDateForViewHeader(this.cycleDay.date)}</Text> <Text style={styles.welcome}>{formatDateForViewHeader(this.cycleDay.date)}</Text>
{ this.cycleDayNumber && <Text>Cycle day {this.cycleDayNumber}</Text> } { this.cycleDayNumber && <Text>Cycle day {this.cycleDayNumber}</Text> }
{ {
{ dayView: <DayView cycleDay={this.cycleDay} bringIntoView={this.showView} />, { dayView: <DayView cycleDay={this.cycleDay} showView={this.showView} />,
bleedingEditView: <BleedingEditView cycleDay={this.cycleDay} bringIntoView={this.showView}/>, bleedingEditView: <BleedingEditView cycleDay={this.cycleDay} showView={this.showView}/>,
temperatureEditView: <TemperatureEditView cycleDay={this.cycleDay} bringIntoView={this.showView}/> temperatureEditView: <TemperatureEditView cycleDay={this.cycleDay} showView={this.showView}/>
}[this.state.visibleComponent] }[this.state.visibleComponent]
} }
......
...@@ -32,7 +32,7 @@ export default class Home extends Component { ...@@ -32,7 +32,7 @@ export default class Home extends Component {
const todayDateString = LocalDate.now().toString() const todayDateString = LocalDate.now().toString()
const cycleDay = getOrCreateCycleDay(todayDateString) const cycleDay = getOrCreateCycleDay(todayDateString)
const navigate = this.props.navigation.navigate const navigate = this.props.navigation.navigate
navigate('day', { cycleDay }) navigate('cycleDay', { cycleDay })
} }
render() { render() {
......
...@@ -13,7 +13,7 @@ export default class Temp extends Component { ...@@ -13,7 +13,7 @@ export default class Temp extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.cycleDay = props.cycleDay this.cycleDay = props.cycleDay
this.showView = props.bringIntoView this.showView = props.showView
let initialValue let initialValue
if(this.cycleDay.temperature) { if(this.cycleDay.temperature) {
......
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