Adds propTypes definition
This commit is contained in:
+11
-1
@@ -2,6 +2,7 @@ import { LocalDate } from 'js-joda'
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { ScrollView, View } from 'react-native'
|
import { ScrollView, View } from 'react-native'
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import { navigate } from '../slices/navigation'
|
import { navigate } from '../slices/navigation'
|
||||||
import { getDate, setDate } from '../slices/date'
|
import { getDate, setDate } from '../slices/date'
|
||||||
@@ -26,6 +27,16 @@ import styles, { cycleDayColor, periodColor, secondaryColor } from '../styles'
|
|||||||
|
|
||||||
class Home extends Component {
|
class Home extends Component {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
navigate: PropTypes.func,
|
||||||
|
setDate: PropTypes.func,
|
||||||
|
// The following three is not being used,
|
||||||
|
// we could see if it's possible to not pass them from the <App />
|
||||||
|
cycleDay: PropTypes.object,
|
||||||
|
date: PropTypes.string,
|
||||||
|
handleBackButtonPress: PropTypes.func,
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
@@ -72,7 +83,6 @@ class Home extends Component {
|
|||||||
<View flex={1}>
|
<View flex={1}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<View style={styles.homeView}>
|
<View style={styles.homeView}>
|
||||||
|
|
||||||
<HomeElement
|
<HomeElement
|
||||||
onPress={this.navigateToCycleDayView}
|
onPress={this.navigateToCycleDayView}
|
||||||
buttonColor={ cycleDayColor }
|
buttonColor={ cycleDayColor }
|
||||||
|
|||||||
Reference in New Issue
Block a user