lbry-desktop/ui/modal/modalRemoveCollection/index.js
zeppi ee9f63a161 integrate all the things
bugfix

wip

flow

fix

cleaning

clean
2021-10-15 23:49:41 -04:00

29 lines
1 KiB
JavaScript

import { connect } from 'react-redux';
import {
makeSelectClaimIsMine,
makeSelectIsAbandoningClaimForUri,
makeSelectClaimForClaimId,
} from 'redux/selectors/claims';
import { doCollectionDelete } from 'redux/actions/collections';
import { makeSelectNameForCollectionId } from 'redux/selectors/collections';
import { doHideModal } from 'redux/actions/app';
import ModalRemoveCollection from './view';
const select = (state, props) => {
const claim = makeSelectClaimForClaimId(props.collectionId)(state);
const uri = (claim && (claim.canonical_url || claim.permanent_url)) || null;
return {
claim,
uri,
claimIsMine: makeSelectClaimIsMine(uri)(state),
isAbandoning: makeSelectIsAbandoningClaimForUri(uri)(state),
collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
};
};
const perform = (dispatch) => ({
closeModal: () => dispatch(doHideModal()),
collectionDelete: (id) => dispatch(doCollectionDelete(id)),
});
export default connect(select, perform)(ModalRemoveCollection);