Lint rule react prop types addition

This commit is contained in:
Maria Zadnepryanets
2020-03-11 20:19:45 +00:00
committed by Sofiya Tepikin
parent 8444d466db
commit 47379d7a1e
26 changed files with 292 additions and 184 deletions
+12 -4
View File
@@ -1,4 +1,5 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { View, FlatList, ActivityIndicator } from 'react-native'
import AppLoadingView from '../app-loading'
@@ -17,6 +18,11 @@ import config from '../../config'
import styles from './styles'
export default class CycleChart extends Component {
static propTypes = {
navigate: PropTypes.func,
end: PropTypes.bool
}
constructor(props) {
super(props)
this.state = {}
@@ -147,12 +153,14 @@ export default class CycleChart extends Component {
}
}
function LoadingMoreView(props) {
function LoadingMoreView({ end }) {
return (
<View style={styles.loadingMore}>
{!props.end &&
<ActivityIndicator size={'large'} color={'white'}/>
}
{!end && <ActivityIndicator size={'large'} color={'white'}/>}
</View>
)
}
LoadingMoreView.propTypes = {
end: PropTypes.bool
}
+13
View File
@@ -1,4 +1,5 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { TouchableOpacity } from 'react-native'
import { connect } from 'react-redux'
@@ -18,6 +19,18 @@ import {
} from '../helpers/chart'
class DayColumn extends Component {
static propTypes = {
dateString: PropTypes.string.isRequired,
chartSymptoms: PropTypes.array,
columnHeight: PropTypes.number.isRequired,
getFhmAndLtlInfo: PropTypes.func.isRequired,
navigate: PropTypes.func.isRequired,
setDate: PropTypes.func.isRequired,
symptomHeight: PropTypes.number.isRequired,
symptomRowSymptoms: PropTypes.array,
xAxisHeight: PropTypes.number
}
constructor(props) {
super()
+10
View File
@@ -1,10 +1,20 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Path, Shape } from 'react-native/Libraries/ART/ReactNativeART'
import styles from './styles'
import config from '../../config'
export default class DotAndLine extends Component {
static propTypes = {
exclude: PropTypes.bool,
leftY: PropTypes.number,
leftTemperatureExclude: PropTypes.bool,
rightY: PropTypes.number,
rightTemperatureExclude: PropTypes.bool,
y: PropTypes.number.isRequired
}
shouldComponentUpdate(newProps) {
return Object.keys(newProps).some(key => newProps[key] != this.props[key])
}