You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
import { connect } from 'react-redux';
|
|
import { createSelector } from 'reselect';
|
|
import { deleteArtist, setDeleteOption } from 'Store/Actions/artistActions';
|
|
import createArtistSelector from 'Store/Selectors/createArtistSelector';
|
|
import DeleteArtistModalContent from './DeleteArtistModalContent';
|
|
|
|
function createMapStateToProps() {
|
|
return createSelector(
|
|
(state) => state.artist.deleteOptions,
|
|
createArtistSelector(),
|
|
(deleteOptions, artist) => {
|
|
return {
|
|
...artist,
|
|
deleteOptions
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
return {
|
|
onDeleteOptionChange(option) {
|
|
dispatch(
|
|
setDeleteOption({
|
|
[option.name]: option.value
|
|
})
|
|
);
|
|
},
|
|
|
|
onDeletePress(deleteFiles, addImportListExclusion) {
|
|
dispatch(
|
|
deleteArtist({
|
|
id: props.artistId,
|
|
deleteFiles,
|
|
addImportListExclusion
|
|
})
|
|
);
|
|
|
|
props.onModalClose(true);
|
|
}
|
|
};
|
|
}
|
|
|
|
export default connect(createMapStateToProps, createMapDispatchToProps)(DeleteArtistModalContent);
|