Created
April 14, 2016 08:28
-
-
Save lesniakania/bbd7f78a924ef5a021630a5ea503e0e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SubmissionsList from './SubmissionsList'; | |
import SubmissionsListPage from './SubmissionsListPage'; | |
import { connect } from 'react-redux'; | |
import { fetchSubmissionsList } from '../actions_creators/SubmissionsListActionsCreator'; | |
class PendingSubmissionsPage extends SubmissionsListPage { | |
componentDidMount() { | |
this.props.dispatch(fetchSubmissionsList('pending')); | |
} | |
render() { | |
return ( | |
<SubmissionsList attributes={this.attributes()} | |
submissions={this.props.submissions} /> | |
); | |
} | |
}; | |
function select(state) { | |
const submissions = Object.keys(state.submissions) | |
.map(k => state.submissions[k]); | |
return { | |
submissions: submissions | |
}; | |
} | |
export default connect(select)(PendingSubmissionsPage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment