mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
chore: tweak action placement
This commit is contained in:
parent
968aec8a11
commit
b041dcb8c4
@ -138,6 +138,40 @@ const DynamicZoneComponent = ({
|
|||||||
|
|
||||||
const composedBoxRefs = composeRefs(boxRef, dropRef);
|
const composedBoxRefs = composeRefs(boxRef, dropRef);
|
||||||
|
|
||||||
|
const accordionActions = !isFieldAllowed ? null : (
|
||||||
|
<Stack horizontal spacing={0} expanded={isOpen}>
|
||||||
|
<IconButtonCustom
|
||||||
|
noBorder
|
||||||
|
label={formatMessage(
|
||||||
|
{
|
||||||
|
id: getTrad('components.DynamicZone.delete-label'),
|
||||||
|
defaultMessage: 'Delete {name}',
|
||||||
|
},
|
||||||
|
{ name: friendlyName }
|
||||||
|
)}
|
||||||
|
onClick={onRemoveComponentClick}
|
||||||
|
>
|
||||||
|
<Trash />
|
||||||
|
</IconButtonCustom>
|
||||||
|
<IconButton
|
||||||
|
forwardedAs="div"
|
||||||
|
role="button"
|
||||||
|
noBorder
|
||||||
|
tabIndex={0}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
data-handler-id={handlerId}
|
||||||
|
ref={dragRef}
|
||||||
|
label={formatMessage({
|
||||||
|
id: getTrad('components.DragHandle-label'),
|
||||||
|
defaultMessage: 'Drag',
|
||||||
|
})}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
>
|
||||||
|
<Drag />
|
||||||
|
</IconButton>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ComponentContainer as="li">
|
<ComponentContainer as="li">
|
||||||
<Flex justifyContent="center">
|
<Flex justifyContent="center">
|
||||||
@ -150,41 +184,7 @@ const DynamicZoneComponent = ({
|
|||||||
<Accordion expanded={isOpen} onToggle={handleToggle} size="S" error={errorMessage}>
|
<Accordion expanded={isOpen} onToggle={handleToggle} size="S" error={errorMessage}>
|
||||||
<AccordionToggle
|
<AccordionToggle
|
||||||
startIcon={<FontAwesomeIcon icon={icon} />}
|
startIcon={<FontAwesomeIcon icon={icon} />}
|
||||||
action={
|
action={accordionActions}
|
||||||
isFieldAllowed ? (
|
|
||||||
<Stack horizontal spacing={0} expanded={isOpen}>
|
|
||||||
<IconButtonCustom
|
|
||||||
noBorder
|
|
||||||
label={formatMessage(
|
|
||||||
{
|
|
||||||
id: getTrad('components.DynamicZone.delete-label'),
|
|
||||||
defaultMessage: 'Delete {name}',
|
|
||||||
},
|
|
||||||
{ name: friendlyName }
|
|
||||||
)}
|
|
||||||
onClick={onRemoveComponentClick}
|
|
||||||
>
|
|
||||||
<Trash />
|
|
||||||
</IconButtonCustom>
|
|
||||||
<IconButton
|
|
||||||
forwardedAs="div"
|
|
||||||
role="button"
|
|
||||||
noBorder
|
|
||||||
tabIndex={0}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
data-handler-id={handlerId}
|
|
||||||
ref={dragRef}
|
|
||||||
label={formatMessage({
|
|
||||||
id: getTrad('components.DragHandle-label'),
|
|
||||||
defaultMessage: 'Drag',
|
|
||||||
})}
|
|
||||||
onKeyDown={handleKeyDown}
|
|
||||||
>
|
|
||||||
<Drag />
|
|
||||||
</IconButton>
|
|
||||||
</Stack>
|
|
||||||
) : null
|
|
||||||
}
|
|
||||||
title={`${friendlyName}${mainValue}`}
|
title={`${friendlyName}${mainValue}`}
|
||||||
togglePosition="left"
|
togglePosition="left"
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user