mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 14:54:12 +00:00
refactor: renamed handler and added comments
This commit is contained in:
parent
d2a3a0ce2d
commit
60c66f11f0
1 changed files with 3 additions and 3 deletions
|
@ -33,13 +33,13 @@ const BookmarkButton = ({ currentAddress, pageTitle }: Props) => {
|
|||
|
||||
const isPageBookmarked = !!bookmarkFound;
|
||||
|
||||
const handleFlyout = () => {
|
||||
const handleAddRemoveBookmarkOnClick = () => {
|
||||
if (isPageBookmarked) {
|
||||
// remove
|
||||
dispatch(removeBookmark(bookmarkFound));
|
||||
return;
|
||||
}
|
||||
// open flyout
|
||||
// open flyout to add Bookmark
|
||||
setOpenFlyout(!openFlyout);
|
||||
};
|
||||
|
||||
|
@ -50,7 +50,7 @@ const BookmarkButton = ({ currentAddress, pageTitle }: Props) => {
|
|||
className={cx('rounded-full', {
|
||||
'text-blue-500': isPageBookmarked,
|
||||
})}
|
||||
onClick={handleFlyout}
|
||||
onClick={handleAddRemoveBookmarkOnClick}
|
||||
title={`${!isPageBookmarked ? 'Add' : 'Remove'} bookmark`}
|
||||
>
|
||||
<Icon
|
||||
|
|
Loading…
Reference in a new issue