2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-04-18 06:03:01 +02:00
|
|
|
import { doDeleteFileAndGoBack } from 'redux/actions/file';
|
|
|
|
import {
|
2018-10-29 18:25:22 +01:00
|
|
|
doHideNotification,
|
2018-04-18 06:03:01 +02:00
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectClaimIsMine,
|
|
|
|
makeSelectFileInfoForUri,
|
|
|
|
} from 'lbry-redux';
|
2017-12-21 22:08:54 +01:00
|
|
|
import ModalRemoveFile from './view';
|
2017-07-02 20:23:38 +02:00
|
|
|
|
2017-09-07 23:18:33 +02:00
|
|
|
const select = (state, props) => ({
|
2017-09-08 05:15:05 +02:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2017-09-17 22:33:52 +02:00
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
2017-09-08 05:15:05 +02:00
|
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
2017-09-07 23:18:33 +02:00
|
|
|
});
|
2017-07-02 20:23:38 +02:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2018-10-29 18:25:22 +01:00
|
|
|
closeModal: () => dispatch(doHideNotification()),
|
2017-07-02 20:23:38 +02:00
|
|
|
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);
|