2017-07-02 20:23:38 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doCloseModal, doHistoryBack } from "actions/app";
|
2017-07-21 10:13:45 +02:00
|
|
|
import { doDeleteFileAndGoBack } from "actions/file_info";
|
2017-07-02 20:23:38 +02:00
|
|
|
import { makeSelectClaimForUriIsMine } from "selectors/claims";
|
2017-07-21 10:13:45 +02:00
|
|
|
import batchActions from "util/batchActions";
|
2017-07-02 20:23:38 +02:00
|
|
|
|
|
|
|
import ModalRemoveFile from "./view";
|
|
|
|
|
|
|
|
const makeSelect = () => {
|
|
|
|
const selectClaimForUriIsMine = makeSelectClaimForUriIsMine();
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claimIsMine: selectClaimForUriIsMine(state, props),
|
|
|
|
});
|
|
|
|
|
|
|
|
return select;
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
closeModal: () => dispatch(doCloseModal()),
|
|
|
|
deleteFile: (fileInfo, deleteFromComputer, abandonClaim) => {
|
2017-07-21 10:13:45 +02:00
|
|
|
dispatch(doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim));
|
2017-07-02 20:23:38 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(makeSelect, perform)(ModalRemoveFile);
|