mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
Renames in Frontend
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { kinds, sizes } from 'Helpers/Props';
|
||||
import Button from 'Components/Link/Button';
|
||||
import Modal from 'Components/Modal/Modal';
|
||||
import ModalContent from 'Components/Modal/ModalContent';
|
||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||
import ModalBody from 'Components/Modal/ModalBody';
|
||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
||||
import styles from './MoveAuthorModal.css';
|
||||
|
||||
function MoveAuthorModal(props) {
|
||||
const {
|
||||
originalPath,
|
||||
destinationPath,
|
||||
destinationRootFolder,
|
||||
isOpen,
|
||||
onSavePress,
|
||||
onMoveAuthorPress
|
||||
} = props;
|
||||
|
||||
if (
|
||||
isOpen &&
|
||||
!originalPath &&
|
||||
!destinationPath &&
|
||||
!destinationRootFolder
|
||||
) {
|
||||
console.error('orginalPath and destinationPath OR destinationRootFolder must be provided');
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
size={sizes.MEDIUM}
|
||||
closeOnBackgroundClick={false}
|
||||
onModalClose={onSavePress}
|
||||
>
|
||||
<ModalContent
|
||||
showCloseButton={true}
|
||||
onModalClose={onSavePress}
|
||||
>
|
||||
<ModalHeader>
|
||||
Move Files
|
||||
</ModalHeader>
|
||||
|
||||
<ModalBody>
|
||||
{
|
||||
destinationRootFolder ?
|
||||
`Would you like to move the author folders to '${destinationRootFolder}'?` :
|
||||
`Would you like to move the author files from '${originalPath}' to '${destinationPath}'?`
|
||||
}
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
<Button
|
||||
className={styles.doNotMoveButton}
|
||||
onPress={onSavePress}
|
||||
>
|
||||
No, I'll Move the Files Myself
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
kind={kinds.DANGER}
|
||||
onPress={onMoveAuthorPress}
|
||||
>
|
||||
Yes, Move the Files
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
MoveAuthorModal.propTypes = {
|
||||
originalPath: PropTypes.string,
|
||||
destinationPath: PropTypes.string,
|
||||
destinationRootFolder: PropTypes.string,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
onSavePress: PropTypes.func.isRequired,
|
||||
onMoveAuthorPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default MoveAuthorModal;
|
||||
Reference in New Issue
Block a user