New: Don't require artist mapping

This commit is contained in:
ta264 2020-02-09 19:15:43 +00:00 committed by Qstick
parent 1cc434a498
commit be4e748977
159 changed files with 2934 additions and 4208 deletions

View file

@ -0,0 +1,58 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { clearPendingChanges } from 'Store/Actions/baseActions';
import { cancelSaveRootFolder } from 'Store/Actions/settingsActions';
import EditRootFolderModal from './EditRootFolderModal';
function createMapDispatchToProps(dispatch, props) {
const section = 'settings.rootFolders';
return {
dispatchClearPendingChanges() {
dispatch(clearPendingChanges({ section }));
},
dispatchCancelSaveRootFolder() {
dispatch(cancelSaveRootFolder({ section }));
}
};
}
class EditRootFolderModalConnector extends Component {
//
// Listeners
onModalClose = () => {
this.props.dispatchClearPendingChanges();
this.props.dispatchCancelSaveRootFolder();
this.props.onModalClose();
}
//
// Render
render() {
const {
dispatchClearPendingChanges,
dispatchCancelSaveRootFolder,
...otherProps
} = this.props;
return (
<EditRootFolderModal
{...otherProps}
onModalClose={this.onModalClose}
/>
);
}
}
EditRootFolderModalConnector.propTypes = {
onModalClose: PropTypes.func.isRequired,
dispatchClearPendingChanges: PropTypes.func.isRequired,
dispatchCancelSaveRootFolder: PropTypes.func.isRequired
};
export default connect(null, createMapDispatchToProps)(EditRootFolderModalConnector);