From 5396e998b3f5d407861604794c5203197adcf094 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:47:12 +1000 Subject: [PATCH] feat(ui): simplify auto-add context menu --- .../Boards/GalleryBoardContextMenuItems.tsx | 15 +++++++-------- .../components/Boards/NoBoardContextMenuItems.tsx | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx index 2e505b91d3..e8bd1be992 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx @@ -5,7 +5,7 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions'; import { autoAddBoardIdChanged } from 'features/gallery/store/gallerySlice'; import { memo, useCallback, useMemo } from 'react'; -import { FaMinus, FaPlus, FaTrash } from 'react-icons/fa'; +import { FaPlus, FaTrash } from 'react-icons/fa'; import { BoardDTO } from 'services/api/types'; type Props = { @@ -59,16 +59,15 @@ const GalleryBoardContextMenuItems = ({ board, setBoardToDelete }: Props) => { */} )} - : } - onClickCapture={handleToggleAutoAdd} - > - {isSelectedForAutoAdd ? 'Disable Auto-Add' : 'Auto-Add to this Board'} - + {!isSelectedForAutoAdd && ( + } onClick={handleToggleAutoAdd}> + Auto-add to this Board + + )} } - onClickCapture={handleDelete} + onClick={handleDelete} > Delete Board diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardContextMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardContextMenuItems.tsx index 57dd7d5f7b..34b4c5f790 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardContextMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/NoBoardContextMenuItems.tsx @@ -17,8 +17,8 @@ const NoBoardContextMenuItems = () => { return ( <> {autoAddBoardId && ( - } onClickCapture={handleDisableAutoAdd}> - Disable Auto-Add + } onClick={handleDisableAutoAdd}> + Auto-add to this Board )}