Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created April 14, 2016 08:28
Show Gist options
  • Save lesniakania/bbd7f78a924ef5a021630a5ea503e0e0 to your computer and use it in GitHub Desktop.
Save lesniakania/bbd7f78a924ef5a021630a5ea503e0e0 to your computer and use it in GitHub Desktop.
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