From fc28b904a0cd7654eb41099455d63388e24b34ca Mon Sep 17 00:00:00 2001 From: Benjamin Elo Date: Mon, 29 Jul 2019 04:20:45 -0700 Subject: [PATCH] Added ability to remove bookmarks Summary: Here I add the ability to remove bookmarks. If a bookmark already exists, a different dialouge menu appears. Reviewed By: danielbuechele Differential Revision: D16540394 fbshipit-source-id: 5d6737e1efb1a9663519bf17084ef3b55a6ba28e --- .../components/SaveBookmarkDialog.js | 22 ++++++++++++++-- src/plugins/navigation/index.js | 25 ++++++++++++++++--- src/plugins/navigation/util/indexedDB.js | 15 +++++++++++ 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/plugins/navigation/components/SaveBookmarkDialog.js b/src/plugins/navigation/components/SaveBookmarkDialog.js index e73036840..33bc52f94 100644 --- a/src/plugins/navigation/components/SaveBookmarkDialog.js +++ b/src/plugins/navigation/components/SaveBookmarkDialog.js @@ -13,8 +13,10 @@ import type {Bookmark} from '../flow-types'; type Props = {| uri: ?string, + edit: boolean, shouldShow: boolean, onHide: ?() => void, + onRemove: string => void, onSubmit: Bookmark => void, |}; @@ -47,7 +49,7 @@ const NameInput = styled(Input)({ }); export default (props: Props) => { - const {shouldShow, onHide, onSubmit, uri} = props; + const {edit, shouldShow, onHide, onRemove, onSubmit, uri} = props; const [commonName, setCommonName] = useState(''); if (uri == null || !shouldShow) { return null; @@ -57,7 +59,9 @@ export default (props: Props) => { {hide => { return ( - Save to bookmarks... + + {edit ? 'Edit bookmark...' : 'Save to bookmarks...'} + { padded> Cancel + {edit ? ( + + ) : null} +