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:
mgabdev
2020-08-18 19:22:15 -05:00
parent e21a6ff897
commit 99982c0391
102 changed files with 2540 additions and 3285 deletions

View File

@@ -11,32 +11,8 @@ import {
import StatusContainer from '../containers/status_container'
import StatusPlaceholder from '../components/placeholder/status_placeholder'
const mapStateToProps = (state, props) => {
const statusId = props.id || props.params.statusId
return {
status: state.getIn(['statuses', statusId]),
}
}
const mapDispatchToProps = (dispatch) => ({
onFetchStatus: (id) => dispatch(fetchStatus(id)),
onFetchContext: (id) => dispatch(fetchContext(id)),
onFetchComments: (id) => dispatch(fetchComments(id)),
})
export default
@connect(mapStateToProps, mapDispatchToProps)
class Status extends ImmutablePureComponent {
static propTypes = {
onFetchContext: PropTypes.func.isRequired,
onFetchStatus: PropTypes.func.isRequired,
onFetchComments: PropTypes.func.isRequired,
params: PropTypes.object,
status: ImmutablePropTypes.map,
}
componentDidMount() {
const statusId = this.props.id || this.props.params.statusId
this.props.onFetchStatus(statusId)
@@ -80,3 +56,27 @@ class Status extends ImmutablePureComponent {
}
}
const mapStateToProps = (state, props) => {
const statusId = props.id || props.params.statusId
return {
status: state.getIn(['statuses', statusId]),
}
}
const mapDispatchToProps = (dispatch) => ({
onFetchStatus: (id) => dispatch(fetchStatus(id)),
onFetchContext: (id) => dispatch(fetchContext(id)),
onFetchComments: (id) => dispatch(fetchComments(id)),
})
Status.propTypes = {
onFetchContext: PropTypes.func.isRequired,
onFetchStatus: PropTypes.func.isRequired,
onFetchComments: PropTypes.func.isRequired,
params: PropTypes.object,
status: ImmutablePropTypes.map,
}
export default connect(mapStateToProps, mapDispatchToProps)(Status)