Add list of files being deleted to delete modal (#3299)

Shows the first 15 file names being deleted. If more then 15, the first 15 will be shown then the last line will be ` + ## other(s)`
This commit is contained in:
Charles Morgan 2021-05-16 14:28:52 -04:00 committed by GitHub
parent bd5472e2e6
commit 3898e40fa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,18 @@ const MassActionsBar = () => {
onConfirmed={onClickConfirmDeletion}
onModalDismissed={() => setShowConfirm(false)}
>
Deleting files is a permanent operation, you cannot undo this action.
Are you sure you want to delete {selectedFiles.length} file(s)?
<br/>
Deleting the file(s) listed below is a permanent operation, you cannot undo this action.
<br/>
<code>
{ selectedFiles.slice(0, 15).map(file => (
<li key={file}>{file}<br/></li>))
}
{ selectedFiles.length > 15 &&
<li> + {selectedFiles.length - 15} other(s) </li>
}
</code>
</ConfirmationModal>
{showMove &&
<RenameFileModal