chore: tweak action placement

This commit is contained in:
Josh 2022-12-06 08:18:50 +00:00
parent 968aec8a11
commit b041dcb8c4

View File

@ -138,20 +138,7 @@ const DynamicZoneComponent = ({
const composedBoxRefs = composeRefs(boxRef, dropRef); const composedBoxRefs = composeRefs(boxRef, dropRef);
return ( const accordionActions = !isFieldAllowed ? null : (
<ComponentContainer as="li">
<Flex justifyContent="center">
<Rectangle background="neutral200" />
</Flex>
<StyledBox ref={composedBoxRefs} hasRadius>
{isDragging ? (
<Preview ref={dragPreviewRef} padding={6} background="primary100" />
) : (
<Accordion expanded={isOpen} onToggle={handleToggle} size="S" error={errorMessage}>
<AccordionToggle
startIcon={<FontAwesomeIcon icon={icon} />}
action={
isFieldAllowed ? (
<Stack horizontal spacing={0} expanded={isOpen}> <Stack horizontal spacing={0} expanded={isOpen}>
<IconButtonCustom <IconButtonCustom
noBorder noBorder
@ -183,8 +170,21 @@ const DynamicZoneComponent = ({
<Drag /> <Drag />
</IconButton> </IconButton>
</Stack> </Stack>
) : null );
}
return (
<ComponentContainer as="li">
<Flex justifyContent="center">
<Rectangle background="neutral200" />
</Flex>
<StyledBox ref={composedBoxRefs} hasRadius>
{isDragging ? (
<Preview ref={dragPreviewRef} padding={6} background="primary100" />
) : (
<Accordion expanded={isOpen} onToggle={handleToggle} size="S" error={errorMessage}>
<AccordionToggle
startIcon={<FontAwesomeIcon icon={icon} />}
action={accordionActions}
title={`${friendlyName}${mainValue}`} title={`${friendlyName}${mainValue}`}
togglePosition="left" togglePosition="left"
/> />