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';
|
2020-07-24 10:42:56 -04:00
|
|
|
import {
|
2021-11-16 12:23:18 +08:00
|
|
|
selectTitleForUri,
|
2020-07-24 10:42:56 -04:00
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectIsAbandoningClaimForUri,
|
2021-11-10 10:30:03 +08:00
|
|
|
selectClaimIsMineForUri,
|
2021-10-17 16:36:14 +08:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { doResolveUri } from 'redux/actions/claims';
|
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) => ({
|
2021-11-10 10:30:03 +08:00
|
|
|
claimIsMine: selectClaimIsMineForUri(state, props.uri),
|
2021-11-16 12:23:18 +08:00
|
|
|
title: selectTitleForUri(state, props.uri),
|
2019-05-09 19:26:03 -04:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2020-07-24 10:42:56 -04:00
|
|
|
isAbandoning: makeSelectIsAbandoningClaimForUri(props.uri)(state),
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
2017-07-02 14:23:38 -04:00
|
|
|
|
2021-10-17 16:36:14 +08:00
|
|
|
const perform = (dispatch) => ({
|
2018-10-29 13:23:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2021-06-24 11:33:11 -03:00
|
|
|
doResolveUri: (uri) => dispatch(doResolveUri(uri)),
|
2022-01-14 16:26:03 -03:00
|
|
|
deleteFile: (uri, deleteFromComputer, abandonClaim, doGoBack, claim) => {
|
|
|
|
dispatch(doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim, doGoBack, claim));
|
2017-07-02 14:23:38 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-07-24 10:42:56 -04:00
|
|
|
export default connect(select, perform)(ModalRemoveFile);
|