Skip to content

Commit

Permalink
Merge pull request #522 from egdose/master
Browse files Browse the repository at this point in the history
added bookmark deletion confirmation prompt, enhancement #274
  • Loading branch information
gergelyszabo94 authored Aug 11, 2024
2 parents 29a75b0 + 1c88fa0 commit 73a7f44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions extension/src/components/Bookmarks/Bookmark/Bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ const Bookmark = ({
}
};

const removeBookmarkFunction = () => {
const removeBookmarkFunction = (closeModal) => {
removeBookmark(itemInfo.appid, itemInfo.contextid, itemInfo.assetid, added);
closeModal();
};

const qualityClass = (itemInfo.quality !== undefined && itemInfo.quality !== null)
Expand Down Expand Up @@ -153,7 +154,7 @@ const Bookmark = ({
</Modal>
</Action>
<Action title="Delete bookmark">
<FontAwesomeIcon icon={faTrash} onClick={removeBookmarkFunction} />
<Modal modalTitle="Are you sure?" opener={<FontAwesomeIcon icon={faTrash} />} validator={removeBookmarkFunction} />
</Action>
</div>
<div className="actions">
Expand Down
9 changes: 6 additions & 3 deletions extension/src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ const Modal = ({
<BSModal.Header closeButton>
<BSModal.Title>{modalTitle}</BSModal.Title>
</BSModal.Header>
<BSModal.Body>
{children}
</BSModal.Body>
{children
&& (
<BSModal.Body>
{children}
</BSModal.Body>
)}
<BSModal.Footer>
<Button className="button button__cancel" onClick={handleClose}>
Close
Expand Down

0 comments on commit 73a7f44

Please sign in to comment.