Revert "Merge branch 'chore/cleanup-date-usage' into 'main'"
This reverts merge request !492
This commit is contained in:
@@ -6,34 +6,31 @@ import AppPage from '../common/app-page'
|
||||
import SymptomBox from './symptom-box'
|
||||
import SymptomPageTitle from './symptom-page-title'
|
||||
|
||||
import { getCycleDay } from '../../db'
|
||||
import { getData, nextDate, prevDate } from '../helpers/cycle-day'
|
||||
import { connect } from 'react-redux'
|
||||
import { getDate } from '../../slices/date'
|
||||
|
||||
import cycleModule from '../../lib/cycle'
|
||||
import { dateToTitle } from '../helpers/format-date'
|
||||
import { getCycleDay } from '../../db'
|
||||
import { getData } from '../helpers/cycle-day'
|
||||
|
||||
import { general as labels } from '../../i18n/en/cycle-day'
|
||||
import { Spacing } from '../../styles'
|
||||
import { SYMPTOMS } from '../../config'
|
||||
|
||||
const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
const CycleDayOverView = ({ date, isTemperatureEditView }) => {
|
||||
const cycleDay = getCycleDay(date)
|
||||
|
||||
const { getCycleDayNumber } = cycleModule()
|
||||
const cycleDayNumber = getCycleDayNumber(date)
|
||||
const subtitle = cycleDayNumber && `${labels.cycleDayNumber}${cycleDayNumber}`
|
||||
const [editedSymptom, setEditedSymptom] = useState(
|
||||
isTemperatureEditView ? 'temperature' : ''
|
||||
)
|
||||
|
||||
const showNextCycleDay = () => {
|
||||
setDate(nextDate(date))
|
||||
}
|
||||
|
||||
const showPrevCycleDay = () => {
|
||||
setDate(prevDate(date))
|
||||
}
|
||||
|
||||
return (
|
||||
<AppPage>
|
||||
<SymptomPageTitle
|
||||
date={date}
|
||||
onNextCycleDay={showNextCycleDay}
|
||||
onPrevCycleDay={showPrevCycleDay}
|
||||
/>
|
||||
<SymptomPageTitle subtitle={subtitle} title={dateToTitle(date)} />
|
||||
<View style={styles.container}>
|
||||
{SYMPTOMS.map((symptom) => {
|
||||
const symptomData =
|
||||
@@ -41,7 +38,6 @@ const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
|
||||
return (
|
||||
<SymptomBox
|
||||
date={date}
|
||||
key={symptom}
|
||||
symptom={symptom}
|
||||
symptomData={symptomData}
|
||||
@@ -59,7 +55,6 @@ const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => {
|
||||
CycleDayOverView.propTypes = {
|
||||
cycleDay: PropTypes.object,
|
||||
date: PropTypes.string,
|
||||
setDate: PropTypes.func,
|
||||
isTemperatureEditView: PropTypes.bool,
|
||||
}
|
||||
|
||||
@@ -72,4 +67,10 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
})
|
||||
|
||||
export default CycleDayOverView
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
date: getDate(state),
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, null)(CycleDayOverView)
|
||||
|
||||
Reference in New Issue
Block a user