Finished updating the reformatting of propTypes and set redux, intl functions to end of component
• Finished: - updating the reformatting of propTypes and set redux, intl functions to end of component • Removed: - Gif implementation
This commit is contained in:
@@ -7,29 +7,8 @@ import { fetchShortcuts } from '../actions/shortcuts'
|
||||
import ColumnIndicator from '../components/column_indicator'
|
||||
import List from '../components/list'
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
isError: state.getIn(['shortcuts', 'isError']),
|
||||
isLoading: state.getIn(['shortcuts', 'isLoading']),
|
||||
shortcuts: state.getIn(['shortcuts', 'items']),
|
||||
})
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onFetchShortcuts() {
|
||||
dispatch(fetchShortcuts())
|
||||
},
|
||||
})
|
||||
|
||||
export default
|
||||
@connect(mapStateToProps, mapDispatchToProps)
|
||||
class Shortcuts extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
isLoading: PropTypes.bool.isRequired,
|
||||
isError: PropTypes.bool.isRequired,
|
||||
onFetchShortcuts: PropTypes.func.isRequired,
|
||||
shortcuts: ImmutablePropTypes.list,
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.onFetchShortcuts()
|
||||
}
|
||||
@@ -61,4 +40,25 @@ class Shortcuts extends ImmutablePureComponent {
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
isError: state.getIn(['shortcuts', 'isError']),
|
||||
isLoading: state.getIn(['shortcuts', 'isLoading']),
|
||||
shortcuts: state.getIn(['shortcuts', 'items']),
|
||||
})
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onFetchShortcuts() {
|
||||
dispatch(fetchShortcuts())
|
||||
},
|
||||
})
|
||||
|
||||
Shortcuts.propTypes = {
|
||||
isLoading: PropTypes.bool.isRequired,
|
||||
isError: PropTypes.bool.isRequired,
|
||||
onFetchShortcuts: PropTypes.func.isRequired,
|
||||
shortcuts: ImmutablePropTypes.list,
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Shortcuts)
|
||||
Reference in New Issue
Block a user