mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): dnd drop label errors w invalid DOM nesting
Make em all strings to prevent nesting `<p>` elements. Slightly changes appearance - font size is a bit smaller.
This commit is contained in:
@@ -66,7 +66,7 @@ type IAIDndImageProps = FlexProps & {
|
||||
fitContainer?: boolean;
|
||||
droppableData?: TypesafeDroppableData;
|
||||
draggableData?: TypesafeDraggableData;
|
||||
dropLabel?: ReactNode;
|
||||
dropLabel?: string;
|
||||
isSelected?: boolean;
|
||||
isSelectedForCompare?: boolean;
|
||||
thumbnail?: boolean;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { Flex, Text } from '@invoke-ai/ui-library';
|
||||
import type { AnimationProps } from 'framer-motion';
|
||||
import { motion } from 'framer-motion';
|
||||
import type { ReactNode } from 'react';
|
||||
import { memo, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
type Props = {
|
||||
isOver: boolean;
|
||||
label?: ReactNode;
|
||||
label?: string;
|
||||
};
|
||||
|
||||
const initial: AnimationProps['initial'] = {
|
||||
@@ -64,7 +63,7 @@ const IAIDropOverlay = (props: Props) => {
|
||||
p={4}
|
||||
>
|
||||
<Text
|
||||
fontSize="xl"
|
||||
fontSize="lg"
|
||||
fontWeight="semibold"
|
||||
color={isOver ? 'invokeYellow.300' : 'base.500'}
|
||||
transitionProperty="common"
|
||||
|
||||
@@ -3,14 +3,13 @@ import { useDroppableTypesafe } from 'features/dnd/hooks/typesafeHooks';
|
||||
import type { TypesafeDroppableData } from 'features/dnd/types';
|
||||
import { isValidDrop } from 'features/dnd/util/isValidDrop';
|
||||
import { AnimatePresence } from 'framer-motion';
|
||||
import type { ReactNode } from 'react';
|
||||
import { memo, useRef } from 'react';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import IAIDropOverlay from './IAIDropOverlay';
|
||||
|
||||
type IAIDroppableProps = {
|
||||
dropLabel?: ReactNode;
|
||||
dropLabel?: string;
|
||||
disabled?: boolean;
|
||||
data?: TypesafeDroppableData;
|
||||
};
|
||||
|
||||
@@ -169,7 +169,7 @@ const GalleryBoard = ({ board, isSelected }: GalleryBoardProps) => {
|
||||
{board.archived && !editingDisclosure.isOpen && <Icon as={PiArchiveBold} fill="base.300" />}
|
||||
{!editingDisclosure.isOpen && <Text variant="subtext">{board.image_count}</Text>}
|
||||
|
||||
<IAIDroppable data={droppableData} dropLabel={<Text fontSize="lg">{t('unifiedCanvas.move')}</Text>} />
|
||||
<IAIDroppable data={droppableData} dropLabel={t('unifiedCanvas.move')} />
|
||||
</Flex>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
@@ -92,7 +92,7 @@ const NoBoardBoard = memo(({ isSelected }: Props) => {
|
||||
</Text>
|
||||
{autoAddBoardId === 'none' && <AutoAddBadge />}
|
||||
<Text variant="subtext">{imagesTotal}</Text>
|
||||
<IAIDroppable data={droppableData} dropLabel={<Text fontSize="lg">{t('unifiedCanvas.move')}</Text>} />
|
||||
<IAIDroppable data={droppableData} dropLabel={t('unifiedCanvas.move')} />
|
||||
</Flex>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
@@ -75,7 +75,6 @@ const ImageFieldInputComponent = (props: FieldComponentProps<ImageFieldInputInst
|
||||
postUploadAction={postUploadAction}
|
||||
useThumbailFallback
|
||||
uploadElement={<UploadElement />}
|
||||
dropLabel={<DropLabel />}
|
||||
minSize={8}
|
||||
>
|
||||
<IAIDndImageIcon
|
||||
@@ -100,14 +99,3 @@ const UploadElement = memo(() => {
|
||||
});
|
||||
|
||||
UploadElement.displayName = 'UploadElement';
|
||||
|
||||
const DropLabel = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Text fontSize={16} fontWeight="semibold">
|
||||
{t('gallery.drop')}
|
||||
</Text>
|
||||
);
|
||||
});
|
||||
|
||||
DropLabel.displayName = 'DropLabel';
|
||||
|
||||
Reference in New Issue
Block a user