mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(ui): tidy up update image board modal
This commit is contained in:
parent
79f0c4d3c4
commit
3c04340f3f
@ -1,8 +1,6 @@
|
|||||||
import { useDisclosure } from '@chakra-ui/react';
|
import { useDisclosure } from '@chakra-ui/react';
|
||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
|
||||||
import { PropsWithChildren, createContext, useCallback, useState } from 'react';
|
import { PropsWithChildren, createContext, useCallback, useState } from 'react';
|
||||||
import { ImageDTO } from 'services/api';
|
import { ImageDTO } from 'services/api';
|
||||||
import { imageAddedToBoard } from '../../services/thunks/board';
|
|
||||||
import { useAddImageToBoardMutation } from 'services/apiSlice';
|
import { useAddImageToBoardMutation } from 'services/apiSlice';
|
||||||
|
|
||||||
export type ImageUsage = {
|
export type ImageUsage = {
|
||||||
@ -41,7 +39,6 @@ type Props = PropsWithChildren;
|
|||||||
|
|
||||||
export const AddImageToBoardContextProvider = (props: Props) => {
|
export const AddImageToBoardContextProvider = (props: Props) => {
|
||||||
const [imageToMove, setImageToMove] = useState<ImageDTO>();
|
const [imageToMove, setImageToMove] = useState<ImageDTO>();
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
|
|
||||||
const [addImageToBoard, result] = useAddImageToBoardMutation();
|
const [addImageToBoard, result] = useAddImageToBoardMutation();
|
||||||
|
@ -6,9 +6,7 @@ import {
|
|||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogOverlay,
|
AlertDialogOverlay,
|
||||||
Box,
|
Box,
|
||||||
Divider,
|
|
||||||
Flex,
|
Flex,
|
||||||
Select,
|
|
||||||
Spinner,
|
Spinner,
|
||||||
Text,
|
Text,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
@ -16,9 +14,6 @@ import IAIButton from 'common/components/IAIButton';
|
|||||||
|
|
||||||
import { memo, useContext, useRef, useState } from 'react';
|
import { memo, useContext, useRef, useState } from 'react';
|
||||||
import { AddImageToBoardContext } from '../../../../app/contexts/AddImageToBoardContext';
|
import { AddImageToBoardContext } from '../../../../app/contexts/AddImageToBoardContext';
|
||||||
import { useSelector } from 'react-redux';
|
|
||||||
import { selectBoardsAll } from '../../store/boardSlice';
|
|
||||||
import IAISelect from '../../../../common/components/IAISelect';
|
|
||||||
import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
import IAIMantineSelect from 'common/components/IAIMantineSelect';
|
||||||
import { useListAllBoardsQuery } from 'services/apiSlice';
|
import { useListAllBoardsQuery } from 'services/apiSlice';
|
||||||
|
|
||||||
@ -46,7 +41,7 @@ const UpdateImageBoardModal = () => {
|
|||||||
<AlertDialogOverlay>
|
<AlertDialogOverlay>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
<AlertDialogHeader fontSize="lg" fontWeight="bold">
|
<AlertDialogHeader fontSize="lg" fontWeight="bold">
|
||||||
Move Image to Board
|
{currentBoard ? 'Move Image to Board' : 'Add Image to Board'}
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
|
|
||||||
<AlertDialogBody>
|
<AlertDialogBody>
|
||||||
@ -86,7 +81,7 @@ const UpdateImageBoardModal = () => {
|
|||||||
}}
|
}}
|
||||||
ml={3}
|
ml={3}
|
||||||
>
|
>
|
||||||
Add to Board
|
{currentBoard ? 'Move' : 'Add'}
|
||||||
</IAIButton>
|
</IAIButton>
|
||||||
</AlertDialogFooter>
|
</AlertDialogFooter>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user