From 178582569090e8840401a37b298d40ad55ff5d2a Mon Sep 17 00:00:00 2001 From: chainchompa Date: Mon, 8 Jul 2024 22:03:42 -0400 Subject: [PATCH] add current gallery board name --- .../Boards/BoardsList/AddBoardButton.tsx | 8 ++--- .../Boards/BoardsList/BoardsList.tsx | 4 +-- .../gallery/components/GalleryBoardName.tsx | 34 +++++-------------- .../components/ImageGalleryContent.tsx | 2 ++ 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx index abf690f693..6b0ebea257 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/AddBoardButton.tsx @@ -5,16 +5,16 @@ import { PiPlusBold } from 'react-icons/pi'; import { useCreateBoardMutation } from 'services/api/endpoints/boards'; type Props = { - privateBoard: boolean; + isPrivateBoard: boolean; }; -const AddBoardButton = ({ privateBoard }: Props) => { +const AddBoardButton = ({ isPrivateBoard }: Props) => { const { t } = useTranslation(); const [createBoard, { isLoading }] = useCreateBoardMutation(); const DEFAULT_BOARD_NAME = t('boards.myBoard'); const handleCreateBoard = useCallback(() => { - createBoard({ board_name: DEFAULT_BOARD_NAME, private_board: privateBoard }); - }, [createBoard, DEFAULT_BOARD_NAME, privateBoard]); + createBoard({ board_name: DEFAULT_BOARD_NAME, is_private: isPrivateBoard }); + }, [createBoard, DEFAULT_BOARD_NAME, isPrivateBoard]); return ( { {t('boards.private')} - + @@ -104,7 +104,7 @@ const BoardsList = () => { {allowPrivateBoards ? t('boards.shared') : t('boards.boards')} - + diff --git a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx index 55aec17ab2..bc851893c4 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx @@ -1,16 +1,9 @@ -import { Button, Flex, Icon, Spacer } from '@invoke-ai/ui-library'; +import { Flex } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; import { memo, useMemo } from 'react'; -import { PiCaretUpBold } from 'react-icons/pi'; import { useBoardName } from 'services/api/hooks/useBoardName'; -type Props = { - isOpen: boolean; - onToggle: () => void; -}; - -const GalleryBoardName = (props: Props) => { - const { isOpen, onToggle } = props; +const GalleryBoardName = () => { const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId); const boardName = useBoardName(selectedBoardId); @@ -23,26 +16,15 @@ const GalleryBoardName = (props: Props) => { return ( - {formattedBoardName} - - ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx index 2207622130..1394de8716 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx @@ -9,6 +9,7 @@ import { PiImagesBold } from 'react-icons/pi'; import { RiServerLine } from 'react-icons/ri'; import BoardsList from './Boards/BoardsList/BoardsList'; +import GalleryBoardName from './GalleryBoardName'; import GalleryImageGrid from './ImageGrid/GalleryImageGrid'; import { GalleryPagination } from './ImageGrid/GalleryPagination'; import { GallerySearch } from './ImageGrid/GallerySearch'; @@ -42,6 +43,7 @@ const ImageGalleryContent = () => { {galleryHeader} +