'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _redux = require('redux');

var _reactRedux = require('../../../../../../common/react-redux');

var _alerts = require('../../../../../../common/actions/alerts');

var _errorsShowing = require('../../../../../../common/actions/errorsShowing');

var _modifications = require('../../../../../../common/actions/modifications');

var _quizzes = require('../../../../../api/quizzes');

var _makeEditable = require('../../../../../../common/components/shared/functionality/makeEditable');

var _makeEditable2 = _interopRequireDefault(_makeEditable);

var _presenter = require('./presenter');

var _presenter2 = _interopRequireDefault(_presenter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function mapStateToProps(state) {
  return {
    errorsShowing: state.get('errorsShowing')
  };
}

var mapDispatchToProps = {
  changeQuizTitle: _modifications.changeQuizTitle,
  hideError: _errorsShowing.hideError,
  saveQuizChange: _quizzes.saveQuizChange,
  screenreaderNotification: _alerts.screenreaderNotification,
  showError: _errorsShowing.showError
};

exports.default = (0, _redux.compose)(_makeEditable2.default, (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps))(_presenter2.default);