2017-07-02 20:23:38 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-08-30 14:48:32 +02:00
|
|
|
import { doCloseModal } 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";
|
|
|
|
|
|
|
|
import ModalRemoveFile from "./view";
|
2017-09-07 23:18:33 +02:00
|
|
|
import { makeSelectFileInfoForUri } from "../../selectors/file_info";
|
2017-07-02 20:23:38 +02:00
|
|
|
|
2017-09-07 23:18:33 +02:00
|
|
|
const select = (state, props) => ({
|
|
|
|
claimIsMine: makeSelectClaimForUriIsMine()(state, props),
|
|
|
|
uri: makeSelectCurrentParam("uri")(state, props),
|
|
|
|
metadata: makeSelectMetadataForUri()(state, props),
|
|
|
|
outpoint: makeSelectFileInfoForUri()(state, props),
|
|
|
|
});
|
2017-07-02 20:23:38 +02:00
|
|
|
|
|
|
|
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
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2017-09-07 23:18:33 +02:00
|
|
|
export default connect(select, perform)(ModalRemoveFile);
|