From cbb474d407655dc322d80306125f59c6fa184843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marti=CC=81n?= Date: Thu, 14 Nov 2024 16:58:58 +0100 Subject: [PATCH 1/2] Add repeatable link warning --- .../lib/models/common/widgets/Link/Form.jsx | 86 +++++++++---------- .../models/common/widgets/Link/components.tsx | 74 ++++++++-------- .../common/widgets/LinkToMedia/Form.jsx | 42 ++++----- 3 files changed, 98 insertions(+), 104 deletions(-) diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx index ded7bd731..9662da9b6 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx @@ -1,4 +1,4 @@ -import { Box, Label } from "theme-ui"; +import { Box, Flex, Label } from "theme-ui"; import { Col, Flex as FlexGrid } from "@/legacy/components/Flex"; import WidgetFormField from "@/legacy/lib/builders/common/EditModal/Field"; @@ -22,57 +22,55 @@ const Form = (props) => { } = formValues; return ( - - {Object.entries(FormFields).map(([key, field]) => ( - - - - ))} - - - - - - - - + + + + + + + - + ); }; diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx index 7d0f7f44c..918299eab 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx @@ -1,4 +1,4 @@ -import { Box, Icon, Tooltip } from "@prismicio/editor-ui"; +import { Box, Icon, Text, Tooltip } from "@prismicio/editor-ui"; import { Checkbox, Flex, Label } from "theme-ui"; import { Col } from "@/legacy/components/Flex"; @@ -53,51 +53,45 @@ export function DisplayTextCheckbox(props: CommonCheckboxProps) { } export function RepeatableCheckbox(props: CommonCheckboxProps) { - const { checked, height, setFieldValue } = props; + const { checked, setFieldValue } = props; return ( - - + - + + See documentation. + + + + + ); } diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx index b761e9410..f0e885602 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx @@ -19,32 +19,34 @@ const Form = (props) => { } = formValues; return ( - - {Object.entries(FormFields).map(([key, field]) => ( - - - - ))} - + <> + + {Object.entries(FormFields).map(([key, field]) => ( + + + + ))} + + - + ); }; From 0d0c3c951fd36e04f8a5ff708b63ea71ea16b2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Thu, 14 Nov 2024 17:26:03 +0100 Subject: [PATCH 2/2] Fix linter --- .../src/legacy/lib/models/common/widgets/Link/Form.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx index 9662da9b6..d15ef8f9b 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/Form.jsx @@ -1,4 +1,4 @@ -import { Box, Flex, Label } from "theme-ui"; +import { Flex } from "theme-ui"; import { Col, Flex as FlexGrid } from "@/legacy/components/Flex"; import WidgetFormField from "@/legacy/lib/builders/common/EditModal/Field";