Chore/retire redux

This commit is contained in:
Sofiya Tepikin
2022-09-10 16:00:19 +00:00
parent 7d0fa07976
commit 176e4f6a70
22 changed files with 86 additions and 320 deletions
+2 -11
View File
@@ -19,9 +19,6 @@ import NoData from './no-data'
import Tutorial from './tutorial'
import YAxis from './y-axis'
import { connect } from 'react-redux'
import { navigate } from '../../slices/navigation'
import { getCycleDaysSortedByDate } from '../../db'
import nothingChanged from '../../db/db-unchanged'
import {
@@ -167,7 +164,7 @@ class CycleChart extends Component {
onLayout={this.onLayout}
scrollViewStyle={styles.page}
>
{!hasDataToDisplay && <NoData />}
{!hasDataToDisplay && <NoData navigate={this.props.navigate} />}
{hasDataToDisplay && !chartHeight && !chartLoaded && <AppLoadingView />}
<View style={styles.chartContainer}>
{shouldShowHint && chartLoaded && (
@@ -261,10 +258,4 @@ const styles = StyleSheet.create({
},
})
const mapDispatchToProps = (dispatch) => {
return {
navigate: (page) => dispatch(navigate(page)),
}
}
export default connect(null, mapDispatchToProps)(CycleChart)
export default CycleChart
+1 -10
View File
@@ -1,9 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { TouchableOpacity } from 'react-native'
import { connect } from 'react-redux'
import { navigate } from '../../slices/navigation'
import { getCycleDay } from '../../db'
@@ -128,10 +125,4 @@ class DayColumn extends Component {
}
}
const mapDispatchToProps = (dispatch) => {
return {
navigate: (page) => dispatch(navigate(page)),
}
}
export default connect(null, mapDispatchToProps)(DayColumn)
export default DayColumn
+1 -10
View File
@@ -5,9 +5,6 @@ import PropTypes from 'prop-types'
import AppText from '../common/app-text'
import Button from '../common/button'
import { connect } from 'react-redux'
import { navigate } from '../../slices/navigation'
import { Containers } from '../../styles'
import { shared } from '../../i18n/en/labels'
@@ -37,10 +34,4 @@ const styles = StyleSheet.create({
},
})
const mapDispatchToProps = (dispatch) => {
return {
navigate: (page) => dispatch(navigate(page)),
}
}
export default connect(null, mapDispatchToProps)(NoData)
export default NoData