Starts using redux store for storing the date
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import React from 'react'
|
||||
import {
|
||||
Switch,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { Switch, ScrollView } from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import { bleeding } from '../../../i18n/en/cycle-day'
|
||||
import SelectTabGroup from '../select-tab-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Bleeding extends SymptomView {
|
||||
class Bleeding extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -67,4 +68,15 @@ export default class Bleeding extends SymptomView {
|
||||
</ScrollView>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Bleeding)
|
||||
@@ -3,13 +3,17 @@ import {
|
||||
Switch,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import { cervix as labels } from '../../../i18n/en/cycle-day'
|
||||
import SelectTabGroup from '../select-tab-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Cervix extends SymptomView {
|
||||
class Cervix extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -99,3 +103,14 @@ export default class Cervix extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Cervix)
|
||||
|
||||
@@ -2,13 +2,17 @@ import React from 'react'
|
||||
import {
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import { intensity, desire } from '../../../i18n/en/cycle-day'
|
||||
import SelectTabGroup from '../select-tab-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Desire extends SymptomView {
|
||||
class Desire extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -49,3 +53,14 @@ export default class Desire extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Desire)
|
||||
|
||||
@@ -2,13 +2,17 @@ import React from 'react'
|
||||
import {
|
||||
ScrollView,
|
||||
TextInput} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import { mood as labels } from '../../../i18n/en/cycle-day'
|
||||
import SelectBoxGroup from '../select-box-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import styles from '../../../styles'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Mood extends SymptomView {
|
||||
class Mood extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -72,3 +76,14 @@ export default class Mood extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Mood)
|
||||
|
||||
@@ -3,6 +3,10 @@ import {
|
||||
Switch,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import { mucus as labels } from '../../../i18n/en/cycle-day'
|
||||
import computeNfpValue from '../../../lib/nfp-mucus'
|
||||
@@ -10,7 +14,7 @@ import SelectTabGroup from '../select-tab-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Mucus extends SymptomView {
|
||||
class Mucus extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -89,3 +93,14 @@ export default class Mucus extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Mucus)
|
||||
|
||||
@@ -3,6 +3,9 @@ import {
|
||||
ScrollView,
|
||||
TextInput,
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import SymptomSection from './symptom-section'
|
||||
@@ -10,7 +13,7 @@ import { noteExplainer } from '../../../i18n/en/cycle-day'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Note extends SymptomView {
|
||||
class Note extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -53,3 +56,14 @@ export default class Note extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Note)
|
||||
|
||||
@@ -3,6 +3,10 @@ import {
|
||||
ScrollView,
|
||||
TextInput,
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import { pain as labels } from '../../../i18n/en/cycle-day'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
import SelectBoxGroup from '../select-box-group'
|
||||
@@ -10,7 +14,7 @@ import SymptomSection from './symptom-section'
|
||||
import styles from '../../../styles'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Pain extends SymptomView {
|
||||
class Pain extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -74,3 +78,14 @@ export default class Pain extends SymptomView {
|
||||
</ScrollView>)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Pain)
|
||||
|
||||
@@ -3,6 +3,10 @@ import {
|
||||
TextInput,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import styles from '../../../styles'
|
||||
import { sex as sexLabels, contraceptives as contraceptivesLabels } from '../../../i18n/en/cycle-day'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
@@ -10,7 +14,7 @@ import SelectBoxGroup from '../select-box-group'
|
||||
import SymptomSection from './symptom-section'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Sex extends SymptomView {
|
||||
class Sex extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -87,3 +91,14 @@ export default class Sex extends SymptomView {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Sex)
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { Component } from 'react'
|
||||
import {
|
||||
View, Alert, TouchableOpacity
|
||||
} from 'react-native'
|
||||
|
||||
import { saveSymptom } from '../../../db'
|
||||
import InfoPopUp from './info-symptom'
|
||||
import Header from '../../header/symptom-view'
|
||||
@@ -10,9 +11,10 @@ import { sharedDialogs } from '../../../i18n/en/cycle-day'
|
||||
import Icon from 'react-native-vector-icons/Entypo'
|
||||
import styles, { iconStyles } from '../../../styles'
|
||||
|
||||
export default class SymptomView extends Component {
|
||||
constructor(props) {
|
||||
class SymptomView extends Component {
|
||||
constructor(props, symptomName) {
|
||||
super()
|
||||
this.symptomName = symptomName
|
||||
this.date = props.date
|
||||
this.navigate = props.navigate
|
||||
this.state = {
|
||||
@@ -95,4 +97,6 @@ export default class SymptomView extends Component {
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default SymptomView
|
||||
|
||||
@@ -5,6 +5,10 @@ import {
|
||||
Keyboard,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import { getDate } from '../../../slices/date'
|
||||
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker-nevo'
|
||||
import padWithZeros from '../../helpers/pad-time-with-zeros'
|
||||
|
||||
@@ -22,7 +26,7 @@ import SymptomView from './symptom-view'
|
||||
|
||||
const minutes = ChronoUnit.MINUTES
|
||||
|
||||
export default class Temp extends SymptomView {
|
||||
class Temp extends SymptomView {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
const cycleDay = props.cycleDay
|
||||
@@ -175,6 +179,17 @@ export default class Temp extends SymptomView {
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
return({
|
||||
date: getDate(state)
|
||||
})
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null
|
||||
)(Temp)
|
||||
|
||||
function makeOutOfRangeWarningMessage(temperature) {
|
||||
if (temperature === '') return
|
||||
const value = Number(temperature)
|
||||
|
||||
Reference in New Issue
Block a user