mirror of
https://github.com/strapi/strapi.git
synced 2025-11-25 14:41:15 +00:00
Merge pull request #19198 from strapi/fix/release-action-menu-styles
fix(content-releases): fix ReleaseActionMenu styles
This commit is contained in:
commit
4b33c7a01b
@ -356,7 +356,11 @@ export const CMReleasesContainer = () => {
|
|||||||
<Typography fontSize={2} fontWeight="bold" variant="omega" textColor="neutral700">
|
<Typography fontSize={2} fontWeight="bold" variant="omega" textColor="neutral700">
|
||||||
{release.name}
|
{release.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ReleaseActionMenu releaseId={release.id} actionId={release.action.id} />
|
<ReleaseActionMenu
|
||||||
|
releaseId={release.id}
|
||||||
|
actionId={release.action.id}
|
||||||
|
hasTriggerBorder
|
||||||
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -34,12 +34,22 @@ const StyledCross = styled(Cross)`
|
|||||||
padding: ${({ theme }) => theme.spaces[1]};
|
padding: ${({ theme }) => theme.spaces[1]};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const StyledIconButton = styled(IconButton)`
|
||||||
|
/* Setting this style inline with borderColor will not apply the style */
|
||||||
|
border: ${({ theme }) => `1px solid ${theme.colors.neutral200}`};
|
||||||
|
`;
|
||||||
|
|
||||||
interface ReleaseActionMenuProps {
|
interface ReleaseActionMenuProps {
|
||||||
releaseId: DeleteReleaseAction.Request['params']['releaseId'];
|
releaseId: DeleteReleaseAction.Request['params']['releaseId'];
|
||||||
actionId: DeleteReleaseAction.Request['params']['actionId'];
|
actionId: DeleteReleaseAction.Request['params']['actionId'];
|
||||||
|
hasTriggerBorder?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ReleaseActionMenu = ({ releaseId, actionId }: ReleaseActionMenuProps) => {
|
export const ReleaseActionMenu = ({
|
||||||
|
releaseId,
|
||||||
|
actionId,
|
||||||
|
hasTriggerBorder = false,
|
||||||
|
}: ReleaseActionMenuProps) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const toggleNotification = useNotification();
|
const toggleNotification = useNotification();
|
||||||
const { formatAPIError } = useAPIErrorHandler();
|
const { formatAPIError } = useAPIErrorHandler();
|
||||||
@ -90,7 +100,7 @@ export const ReleaseActionMenu = ({ releaseId, actionId }: ReleaseActionMenuProp
|
|||||||
- The Icon doesn't actually show unless you hack it with some padding...and it's still a little strange
|
- The Icon doesn't actually show unless you hack it with some padding...and it's still a little strange
|
||||||
*/}
|
*/}
|
||||||
<Menu.Trigger
|
<Menu.Trigger
|
||||||
as={IconButton}
|
as={hasTriggerBorder ? StyledIconButton : IconButton}
|
||||||
paddingLeft={2}
|
paddingLeft={2}
|
||||||
paddingRight={2}
|
paddingRight={2}
|
||||||
aria-label={formatMessage({
|
aria-label={formatMessage({
|
||||||
@ -106,10 +116,10 @@ export const ReleaseActionMenu = ({ releaseId, actionId }: ReleaseActionMenuProp
|
|||||||
*/}
|
*/}
|
||||||
<Menu.Content top={1} popoverPlacement="bottom-end">
|
<Menu.Content top={1} popoverPlacement="bottom-end">
|
||||||
<CheckPermissions permissions={PERMISSIONS.deleteAction}>
|
<CheckPermissions permissions={PERMISSIONS.deleteAction}>
|
||||||
<StyledMenuItem color="danger600" onSelect={handleDeleteAction}>
|
<StyledMenuItem onSelect={handleDeleteAction}>
|
||||||
<Flex gap={2}>
|
<Flex gap={2}>
|
||||||
<StyledCross />
|
<StyledCross />
|
||||||
<Typography variant="omega">
|
<Typography textColor="danger600" variant="omega">
|
||||||
{formatMessage({
|
{formatMessage({
|
||||||
id: 'content-releases.content-manager-edit-view.remove-from-release',
|
id: 'content-releases.content-manager-edit-view.remove-from-release',
|
||||||
defaultMessage: 'Remove from release',
|
defaultMessage: 'Remove from release',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user