Lint rule react prop types addition
This commit is contained in:
committed by
Sofiya Tepikin
parent
8444d466db
commit
47379d7a1e
@@ -1,4 +1,5 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { TouchableOpacity, ScrollView } from 'react-native'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
@@ -21,7 +22,7 @@ const menu = [
|
||||
{title: labels.license, component: 'License'}
|
||||
]
|
||||
|
||||
const SettingsMenu = (props) => {
|
||||
const SettingsMenu = ({ navigate }) => {
|
||||
return (
|
||||
<ScrollView>
|
||||
{ menu.map(menuItem)}
|
||||
@@ -33,7 +34,7 @@ const SettingsMenu = (props) => {
|
||||
<TouchableOpacity
|
||||
style={styles.framedSegment}
|
||||
key={item.title}
|
||||
onPress={() => props.navigate(item.component)}
|
||||
onPress={() => navigate(item.component)}
|
||||
>
|
||||
<AppText>{item.title.toLowerCase()}</AppText>
|
||||
</TouchableOpacity>
|
||||
@@ -41,6 +42,10 @@ const SettingsMenu = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsMenu.propTypes = {
|
||||
navigate: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return({
|
||||
navigate: (page) => dispatch(navigate(page)),
|
||||
|
||||
Reference in New Issue
Block a user