diff --git a/.changeset/proud-ties-arrive.md b/.changeset/proud-ties-arrive.md new file mode 100644 index 0000000000..a04f9fa4dd --- /dev/null +++ b/.changeset/proud-ties-arrive.md @@ -0,0 +1,5 @@ +--- +"@comet/cms-admin": minor +--- + +Rework the DAM crop/focus settings UI diff --git a/packages/admin/cms-admin/src/blocks/image/EditImageDialog.tsx b/packages/admin/cms-admin/src/blocks/image/EditImageDialog.tsx index b8ebba1978..a1729488e4 100644 --- a/packages/admin/cms-admin/src/blocks/image/EditImageDialog.tsx +++ b/packages/admin/cms-admin/src/blocks/image/EditImageDialog.tsx @@ -160,7 +160,7 @@ export function EditImageDialog({ image, initialValues, onSubmit, onClose, inher
{inheritedDamSettings !== undefined && ( <> - + } disableMarginBottom @@ -183,7 +183,7 @@ export function EditImageDialog({ image, initialValues, onSubmit, onClose, inher {dependencyMap["DamFile"] && damFileId && ( )} - + )} diff --git a/packages/admin/cms-admin/src/common/image/ChooseFocalPoint.tsx b/packages/admin/cms-admin/src/common/image/ChooseFocalPoint.tsx index 534bf83239..287b55d414 100644 --- a/packages/admin/cms-admin/src/common/image/ChooseFocalPoint.tsx +++ b/packages/admin/cms-admin/src/common/image/ChooseFocalPoint.tsx @@ -1,6 +1,6 @@ import { FocusPointCenter, FocusPointNortheast, FocusPointNorthwest, FocusPointSoutheast, FocusPointSouthwest } from "@comet/admin-icons"; import { AdminComponentSection } from "@comet/blocks-admin"; -import { ToggleButton, ToggleButtonGroup, Typography } from "@mui/material"; +import { ToggleButton, ToggleButtonGroup } from "@mui/material"; import { FormattedMessage } from "react-intl"; import { GQLFocalPoint } from "../../graphql.generated"; @@ -12,7 +12,10 @@ interface ChooseFocalPointProps { export const ChooseFocalPoint = ({ focalPoint, onChangeFocalPoint }: ChooseFocalPointProps) => { return ( - }> + } + disableBottomMargin + > { @@ -40,12 +43,6 @@ export const ChooseFocalPoint = ({ focalPoint, onChangeFocalPoint }: ChooseFocal - - - ); }; diff --git a/packages/admin/cms-admin/src/dam/FileForm/CropSettingsFields.tsx b/packages/admin/cms-admin/src/dam/FileForm/CropSettingsFields.tsx index baf398d820..eba3511e92 100644 --- a/packages/admin/cms-admin/src/dam/FileForm/CropSettingsFields.tsx +++ b/packages/admin/cms-admin/src/dam/FileForm/CropSettingsFields.tsx @@ -1,6 +1,7 @@ import { Field, FieldContainer, FormSection } from "@comet/admin"; import { Reset } from "@comet/admin-icons"; -import { Box, Button, FormControlLabel, Switch, Typography } from "@mui/material"; +import { AdminComponentSection } from "@comet/blocks-admin"; +import { Button, FormControlLabel, Switch } from "@mui/material"; import { styled } from "@mui/material/styles"; import { ChangeEvent } from "react"; import { useForm, useFormState } from "react-final-form"; @@ -35,33 +36,54 @@ export function CropSettingsFields({ disabled }: Props): JSX.Element { return ( }> - - } - label={} - /> - - + - - +
+
-
-
+ + } + > + } + > + } + label={ + focalPoint === "SMART" ? ( + + ) : ( + + ) + } + /> +
{showChooseManualFocusPointButtons && ( - + + } + > {({ input: { value, onChange } }) => } )} {showResetCropAreaButton && ( - + {({ input: { value, onChange } }) => (