'use strict';

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

var _reactRedux = require('react-redux');

var _ProtectedRoute = require('../../components/routes/ProtectedRoute');

var _ProtectedRoute2 = _interopRequireDefault(_ProtectedRoute);

var _reducers = require('../../reducers');

var _login = require('../../actions/login');

var _notification = require('../../actions/notification');

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

const mapStateToProps = state => ({
  openModalName: (0, _reducers.getOpenModalName)(state),
  perms: (0, _reducers.getUserPerms)(state),
  username: (0, _reducers.getUserUsername)(state),
  screenName: (0, _reducers.getUserScreenName)(state)
});

const mapDispatchToProps = {
  closeModal: _notification.closeModal,
  redirectLogin: _login.redirectLogin,
  resetLogin: _login.resetLogin
};

exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ProtectedRoute2.default);