diff --git a/app.js b/app.js index 012b396d4e7e39bd6e98197f860b69cda2fa879e..70c1a05017db8631781f85808d75ba4c1271bf0b 100644 --- a/app.js +++ b/app.js @@ -2,7 +2,7 @@ import { createStackNavigator } from 'react-navigation' import Home from './home' 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 import { YellowBox } from 'react-native' @@ -11,5 +11,5 @@ YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated']) export default createStackNavigator({ home: { screen: Home }, calendar: { screen: Calendar }, - day: { screen: Day } + cycleDay: { screen: CycleDay } }) diff --git a/bleeding.js b/bleeding.js index 2854aeb968e77ba280d4bf1cc05e4d5a3a037faf..4019e9c498fb68c14a531ae3a0e4d08ad65c6f4f 100644 --- a/bleeding.js +++ b/bleeding.js @@ -14,7 +14,7 @@ export default class Bleeding extends Component { constructor(props) { super(props) this.cycleDay = props.cycleDay - this.showView = props.bringIntoView + this.showView = props.showView let bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value if (! (typeof bleedingValue === 'number') ){ bleedingValue = -1 diff --git a/calendar.js b/calendar.js index 2274a14e59b82f789f3e44aa32a5b07c2f92616d..28806473bb4b14276fd5e84775fb05efb155ff37 100644 --- a/calendar.js +++ b/calendar.js @@ -19,7 +19,7 @@ export default class DatePickView extends Component { passDateToDayView(result) { const cycleDay = getOrCreateCycleDay(result.dateString) const navigate = this.props.navigation.navigate - navigate('day', { cycleDay }) + navigate('cycleDay', { cycleDay }) } render() { diff --git a/cycle-day-overview.js b/cycle-day-overview.js index bafe44e3659dae02791e4308f2f52472968a4638..eca8cb68b62fba388dd1eed2debb06710e15b65f 100644 --- a/cycle-day-overview.js +++ b/cycle-day-overview.js @@ -15,7 +15,7 @@ export default class DayView extends Component { constructor(props) { super(props) this.cycleDay = props.cycleDay - this.showView = props.bringIntoView + this.showView = props.showView bleedingDaysSortedByDate.addListener(setStateWithCurrentCycleDayNumber.bind(this)) } diff --git a/cycle-day.js b/cycle-day.js index f16fb855623c04bc2a6939741838a8753eb239d0..de5a577e50d0a9a1c958ac71c55efe13240194e5 100644 --- a/cycle-day.js +++ b/cycle-day.js @@ -33,9 +33,9 @@ export default class Day extends Component { <Text style={styles.welcome}>{formatDateForViewHeader(this.cycleDay.date)}</Text> { this.cycleDayNumber && <Text>Cycle day {this.cycleDayNumber}</Text> } { - { dayView: <DayView cycleDay={this.cycleDay} bringIntoView={this.showView} />, - bleedingEditView: <BleedingEditView cycleDay={this.cycleDay} bringIntoView={this.showView}/>, - temperatureEditView: <TemperatureEditView cycleDay={this.cycleDay} bringIntoView={this.showView}/> + { dayView: <DayView cycleDay={this.cycleDay} showView={this.showView} />, + bleedingEditView: <BleedingEditView cycleDay={this.cycleDay} showView={this.showView}/>, + temperatureEditView: <TemperatureEditView cycleDay={this.cycleDay} showView={this.showView}/> }[this.state.visibleComponent] } diff --git a/home.js b/home.js index 98f79cd1db3521a87e4c6e72884046b778f56a71..81b2d13d57fc45a1571e7ec78c635bf3d9e3986f 100644 --- a/home.js +++ b/home.js @@ -32,7 +32,7 @@ export default class Home extends Component { const todayDateString = LocalDate.now().toString() const cycleDay = getOrCreateCycleDay(todayDateString) const navigate = this.props.navigation.navigate - navigate('day', { cycleDay }) + navigate('cycleDay', { cycleDay }) } render() { diff --git a/temperature.js b/temperature.js index fe2a9a76720707e081d0e4df4d2ccad43a7369d4..786248bfd7e8d211ab1552efcefcd2f544b86132 100644 --- a/temperature.js +++ b/temperature.js @@ -13,7 +13,7 @@ export default class Temp extends Component { constructor(props) { super(props) this.cycleDay = props.cycleDay - this.showView = props.bringIntoView + this.showView = props.showView let initialValue if(this.cycleDay.temperature) {