Skip to content
Snippets Groups Projects
Commit aa216559 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Removes redundant state and corrects the cycle day prop

parent 76101eec
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ import React, { Component } from 'react'
import { View, BackHandler } from 'react-native'
import PropTypes from 'prop-types'
import { LocalDate } from 'js-joda'
import { connect } from 'react-redux'
import { getDate, setDate } from '../slices/date'
......@@ -27,13 +26,6 @@ class App extends Component {
constructor(props) {
super(props)
this.todayDateString = LocalDate.now().toString()
props.setDate(this.todayDateString)
this.state = {
cycleDay: getCycleDay(this.todayDateString),
}
this.backHandler = BackHandler.addEventListener(
'hardwareBackPress',
props.goBack
......@@ -54,8 +46,6 @@ class App extends Component {
return false
}
const { cycleDay } = this.state
const Page = viewsList[currentPage]
const title = headerTitles[currentPage]
......@@ -69,7 +59,7 @@ class App extends Component {
}
const pageProps = {
cycleDay,
cycleDay: date && getCycleDay(date),
date,
handleBackButtonPress: goBack,
}
......@@ -108,4 +98,4 @@ const mapDispatchToProps = (dispatch) => {
export default connect(
mapStateToProps,
mapDispatchToProps
)(App)
\ No newline at end of file
)(App)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment