"use strict";

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

var _ui = require("../actions/ui");

var _data = require("../actions/data");

var _images = require("../actions/images");

var _upload = require("../actions/upload");

var _flickr = require("../actions/flickr");

var _files = require("../actions/files");

var _links = require("../actions/links");

/*
 * Copyright (C) 2018 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */
function propsFromDispatch(dispatch) {
  return {
    onChangeTab: function onChangeTab(index) {
      return dispatch((0, _ui.changeTab)(index));
    },
    onChangeAccordion: function onChangeAccordion(index) {
      return dispatch((0, _ui.changeAccordion)(index));
    },
    fetchInitialPage: function fetchInitialPage(key) {
      return dispatch((0, _data.fetchInitialPage)(key));
    },
    fetchNextPage: function fetchNextPage(key) {
      return dispatch((0, _data.fetchNextPage)(key));
    },
    toggleFolder: function toggleFolder(id) {
      return dispatch((0, _files.toggle)(id));
    },
    fetchFolders: function fetchFolders() {
      return dispatch((0, _upload.fetchFolders)());
    },
    fetchImages: function fetchImages(calledFromRender) {
      return dispatch((0, _images.fetchImages)(calledFromRender));
    },
    startUpload: function startUpload(tabContext, fileMetaProps) {
      return dispatch((0, _upload.uploadPreflight)(tabContext, fileMetaProps));
    },
    flickrSearch: function flickrSearch(term) {
      return dispatch((0, _flickr.searchFlickr)(term));
    },
    toggleFlickrForm: function toggleFlickrForm() {
      return dispatch((0, _flickr.openOrCloseFlickrForm)());
    },
    toggleUploadForm: function toggleUploadForm() {
      return dispatch((0, _upload.openOrCloseUploadForm)());
    },
    toggleNewPageForm: function toggleNewPageForm() {
      return dispatch((0, _links.openOrCloseNewPageForm)());
    }
  };
}