From a96e34d2d191944ce58785477e4837c6c5600790 Mon Sep 17 00:00:00 2001 From: chainchompa Date: Tue, 9 Jul 2024 18:46:26 -0400 Subject: [PATCH] remove collapsibles and update board title --- .../Boards/BoardsList/BoardsList.tsx | 111 ++++++------------ .../gallery/components/GalleryBoardName.tsx | 47 ++------ .../components/ImageGalleryContent.tsx | 5 +- 3 files changed, 42 insertions(+), 121 deletions(-) diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx index 7b572bd9ec..9dfb4a2860 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx @@ -1,4 +1,4 @@ -import { Collapse, Flex, Icon, Text, useDisclosure } from '@invoke-ai/ui-library'; +import { Flex, Icon, Text, useDisclosure } from '@invoke-ai/ui-library'; import { EMPTY_ARRAY } from 'app/store/constants'; import { useAppSelector } from 'app/store/storeHooks'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; @@ -22,20 +22,13 @@ const overlayScrollbarsStyles: CSSProperties = { width: '100%', }; -type Props = { - isOpen: boolean; -}; - -const BoardsList = (props: Props) => { - const { isOpen } = props; +const BoardsList = () => { const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId); const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText); const allowPrivateBoards = useAppSelector((s) => s.config.allowPrivateBoards); const queryArgs = useAppSelector(selectListBoardsQueryArgs); const { data: boards } = useListAllBoardsQuery(queryArgs); const [boardToDelete, setBoardToDelete] = useState(); - const privateBoardsDisclosure = useDisclosure({ defaultIsOpen: false }); - const sharedBoardsDisclosure = useDisclosure({ defaultIsOpen: false }); const { t } = useTranslation(); const { filteredPrivateBoards, filteredSharedBoards } = useMemo(() => { @@ -49,75 +42,20 @@ const BoardsList = (props: Props) => { return ( <> - - - + + + {allowPrivateBoards && ( <> - - - - - {t('boards.private')} - - + + + {t('boards.private')} + - - - - - {filteredPrivateBoards.map((board) => ( - - ))} - - - - - )} - - - - - {allowPrivateBoards ? t('boards.shared') : t('boards.boards')} - - - - - - - - {!allowPrivateBoards && } - {filteredSharedBoards.map((board) => ( + + + {filteredPrivateBoards.map((board) => ( { /> ))} - - - - + + )} + + + {allowPrivateBoards ? t('boards.shared') : t('boards.boards')} + + + + + {!allowPrivateBoards && } + {filteredSharedBoards.map((board) => ( + + ))} + + + ); diff --git a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx index 7b3d2e3537..9e9d8bee39 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx @@ -1,50 +1,17 @@ -import { Button, Flex, Icon, Spacer } from '@invoke-ai/ui-library'; +import { Flex, Text } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; -import { memo, useMemo } from 'react'; -import { PiCaretUpBold } from 'react-icons/pi'; +import { memo } from 'react'; 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); - const formattedBoardName = useMemo(() => { - if (boardName.length > 20) { - return `${boardName.substring(0, 20)}...`; - } - return boardName; - }, [boardName]); - return ( - - - {formattedBoardName} - - + + + {boardName} + ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx index 44f3f8d6d9..74901b0f58 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx @@ -41,7 +41,6 @@ const ImageGalleryContent = () => { const dispatch = useAppDispatch(); const galleryHeader = useStore($galleryHeader); const searchDisclosure = useDisclosure({ defaultIsOpen: false }); - const { isOpen: isBoardListOpen, onToggle: onToggleBoardList } = useDisclosure({ defaultIsOpen: true }); const handleClickImages = useCallback(() => { dispatch(galleryViewChanged('images')); @@ -55,10 +54,10 @@ const ImageGalleryContent = () => { {galleryHeader} - + - +