Replace getOrCreateCycleDay

This commit is contained in:
Julia Friesel
2018-11-16 14:24:16 +01:00
parent ecca6cfda9
commit bb0a535d65
18 changed files with 255 additions and 309 deletions
+3 -9
View File
@@ -7,7 +7,6 @@ import { LocalDate } from 'js-joda'
import moment from 'moment'
import styles from './styles'
import config from '../../config'
import { getOrCreateCycleDay } from '../../db'
import cycleModule from '../../lib/cycle'
import { getCycleDay } from '../../db'
import DotAndLine from './dot-and-line'
@@ -58,13 +57,8 @@ export default class DayColumn extends Component {
)
}
passDateToDayView(dateString) {
const cycleDay = getOrCreateCycleDay(dateString)
this.props.navigate('CycleDay', { cycleDay })
}
shouldComponentUpdate(newProps) {
return Object.keys(newProps).some(key => newProps[key] != this.props[key])
shouldComponentUpdate() {
return false
}
render() {
@@ -232,7 +226,7 @@ export default class DayColumn extends Component {
return (
<TouchableOpacity
onPress={() => this.passDateToDayView(dateString)}
onPress={() => this.props.navigate('CycleDay', { date: dateString })}
activeOpacity={1}
>
<View>