Skip to content

Commit

Permalink
Remove deletion prompt and refactor delete function (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennuttall authored Apr 21, 2020
1 parent 8301ebe commit faf4cce
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/TranscriptCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ import {
const TranscriptCard = props => {

const handleDelete = () => {
const confirmDeleteText = 'Are you sure you want to delete?';
const cancelDeleteText = 'Cancelled delete';
const confirmed = confirm('Are you sure you want to delete?');

const confirmationPrompt = confirm(confirmDeleteText);

if (confirmationPrompt) {
if (confirmed) {
if (props.handleDeleteItem) {
props.handleDeleteItem(props.id);
}
} else {
alert(cancelDeleteText);
}
};

Expand Down

0 comments on commit faf4cce

Please sign in to comment.