2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-04-19 12:55:21 -04:00
|
|
|
import { doDeleteFileAndMaybeGoBack } from 'redux/actions/file';
|
2019-08-14 22:50:41 -04:00
|
|
|
import { makeSelectTitleForUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { doHideModal } from 'redux/actions/app';
|
2017-12-21 18:08:54 -03:00
|
|
|
import ModalRemoveFile from './view';
|
2017-07-02 14:23:38 -04:00
|
|
|
|
2017-09-07 17:18:33 -04:00
|
|
|
const select = (state, props) => ({
|
2017-09-07 23:15:05 -04:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2017-09-17 16:33:52 -04:00
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
2019-05-09 19:26:03 -04:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
2017-07-02 14:23:38 -04:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2018-10-29 13:23:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2019-08-14 22:50:41 -04:00
|
|
|
deleteFile: (uri, deleteFromComputer, abandonClaim) => {
|
|
|
|
dispatch(doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim));
|
2017-07-02 14:23:38 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2018-11-01 22:55:25 +01:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(ModalRemoveFile);
|