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] 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]) => ( + + + + ))} + + - + ); };