Starts using redux store for storing the date
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user