2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2019-04-19 18:55:21 +02:00
|
|
|
import { doDeleteFileAndMaybeGoBack } from 'redux/actions/file';
|
2020-07-24 16:42:56 +02:00
|
|
|
import {
|
2022-01-20 02:46:01 +01:00
|
|
|
selectTitleForUri,
|
2021-12-31 18:52:26 +01:00
|
|
|
selectClaimForUri,
|
2020-07-24 16:42:56 +02:00
|
|
|
makeSelectIsAbandoningClaimForUri,
|
2022-01-20 02:46:01 +01:00
|
|
|
selectClaimIsMineForUri,
|
2021-10-08 05:47:39 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { doResolveUri } from 'redux/actions/claims';
|
2018-10-29 18:23:53 +01:00
|
|
|
import { doHideModal } from 'redux/actions/app';
|
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) => ({
|
2022-01-20 02:46:01 +01:00
|
|
|
claimIsMine: selectClaimIsMineForUri(state, props.uri),
|
|
|
|
title: selectTitleForUri(state, props.uri),
|
2021-12-31 18:52:26 +01:00
|
|
|
claim: selectClaimForUri(state, props.uri),
|
2020-07-24 16:42:56 +02:00
|
|
|
isAbandoning: makeSelectIsAbandoningClaimForUri(props.uri)(state),
|
2017-09-07 23:18:33 +02:00
|
|
|
});
|
2017-07-02 20:23:38 +02:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2018-10-29 18:23:53 +01:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2021-06-24 16:33:11 +02:00
|
|
|
doResolveUri: (uri) => dispatch(doResolveUri(uri)),
|
|
|
|
deleteFile: (uri, deleteFromComputer, abandonClaim, doGoBack) => {
|
|
|
|
dispatch(doDeleteFileAndMaybeGoBack(uri, deleteFromComputer, abandonClaim, doGoBack));
|
2017-07-02 20:23:38 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-07-24 16:42:56 +02:00
|
|
|
export default connect(select, perform)(ModalRemoveFile);
|