Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount() {
- const { actions } = this.props;
- this.increase = this.increase.bind(this);
- // api call from the saga
- actions.surveyAnswersRequest();
- // set breadcrumb
- actions.setBreadcrumb([{ title: 'Score' }]);
- actions.setTitle('Score');
- this.increase();
- }
- render() {
- const { global, gallery, survey_answers, survey, survey_actual_answers } = this.props;
- if (global.isFetching) {
- return <Loading />;
- }
- return this.view({ gallery, survey_answers, survey, survey_actual_answers });
- }
- Score.propTypes = {
- actions: PropTypes.object.isRequired,
- global: PropTypes.object.isRequired,
- survey: PropTypes.object.isRequired,
- survey_answers: PropTypes.object.isRequired,
- gallery: PropTypes.object.isRequired,
- survey_actual_answers: PropTypes.array.isRequired,
- survey_score_system: PropTypes.array.isRequired,
- survey_styles: PropTypes.object.isRequired,
- survey_general_doc_data: PropTypes.object.isRequired
- };
- function mapStateToProps(state, ownProps) {
- return {
- ...ownProps,
- global: state.global,
- gallery: state.gallery,
- survey: state.survey,
- survey_actual_answers: state.survey.survey_actual_answers,
- survey_answers: state.survey.survey_answers,
- survey_score_system: state.survey.survey_score_system,
- survey_styles: state.survey.survey_styles,
- survey_general_doc_data: state.survey.survey_general_doc_data,
- isFetching: state.isFetching
- };
- }
- function mapDispatchToProps(dispatch) {
- return {
- actions: bindActionCreators({
- ...globalActions,
- ...galleryActions,
- ...surveyActions
- }, dispatch)
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement