fix: Cancel Button not maintaining min height

After the recent changes the Cancel button wasn't maintaining min height in floating mode. Also the new button group was not scaling in width correctly on the Canvas Beta UI. Fixed both.
This commit is contained in:
blessedcoolant 2023-02-20 05:18:37 +13:00
parent 2cd7bd4a8e
commit 8ae71303a5
2 changed files with 13 additions and 4 deletions

View File

@ -40,11 +40,15 @@ const cancelButtonSelector = createSelector(
}
);
interface CancelButtonProps {
btnGroupWidth?: string | number;
}
export default function CancelButton(
props: Omit<IAIIconButtonProps, 'aria-label'>
props: CancelButtonProps & Omit<IAIIconButtonProps, 'aria-label'>
) {
const dispatch = useAppDispatch();
const { ...rest } = props;
const { btnGroupWidth = 'auto', ...rest } = props;
const {
isProcessing,
isConnected,
@ -91,7 +95,12 @@ export default function CancelButton(
];
return (
<ButtonGroup isAttached variant="link">
<ButtonGroup
isAttached
variant="link"
minHeight="2.5rem"
width={btnGroupWidth}
>
{cancelType === 'immediate' ? (
<IAIIconButton
icon={<MdCancel />}

View File

@ -38,7 +38,7 @@ export default function UnifiedCanvasProcessingButtons() {
<InvokeButton iconButton />
</Flex>
<Flex>
<CancelButton width="100%" height="40px" />
<CancelButton width="100%" height="40px" btnGroupWidth="100%" />
</Flex>
</Flex>
);