fix(ui): Set Min Width for Nodes

This commit is contained in:
blessedcoolant 2023-04-23 00:55:43 +12:00
parent f258aba6d1
commit b73fd2a6d2
3 changed files with 6 additions and 1 deletions

View File

@ -60,3 +60,5 @@ export const IN_PROGRESS_IMAGE_TYPES: Array<{
{ key: 'Fast', value: 'latents' },
{ key: 'Accurate', value: 'full-res' },
];
export const NODE_MIN_WIDTH = 250;

View File

@ -1,3 +1,4 @@
import { NODE_MIN_WIDTH } from 'app/constants';
import { memo } from 'react';
import { NodeResizeControl, NodeResizerProps } from 'reactflow';
@ -14,7 +15,7 @@ const IAINodeResizer = (props: NodeResizerProps) => {
bottom: 0,
right: 0,
}}
minWidth={350}
minWidth={NODE_MIN_WIDTH}
{...rest}
></NodeResizeControl>
);

View File

@ -12,6 +12,7 @@ import { RootState } from 'app/store';
import { AnyInvocationType } from 'services/events/types';
import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/storeHooks';
import { NODE_MIN_WIDTH } from 'app/constants';
type InvocationComponentWrapperProps = PropsWithChildren & {
selected: boolean;
@ -28,6 +29,7 @@ const InvocationComponentWrapper = (props: InvocationComponentWrapperProps) => {
sx={{
position: 'relative',
borderRadius: 'md',
minWidth: NODE_MIN_WIDTH,
boxShadow: props.selected
? `${nodeSelectedOutline}, ${nodeShadow}`
: `${nodeShadow}`,