From 40d4ba6a4b65e8da0522a1749d8beb895b7bc871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Sat, 14 Sep 2024 19:40:11 +0100 Subject: [PATCH 1/2] feat: Editor modal --- .../src/@planx/components/Page/Editor.tsx | 86 ++++++++++++++++++- .../src/@planx/components/Page/model.ts | 19 +++- .../components/Page/schema/AdvertConsent.ts | 41 +++++++++ 3 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 editor.planx.uk/src/@planx/components/Page/schema/AdvertConsent.ts diff --git a/editor.planx.uk/src/@planx/components/Page/Editor.tsx b/editor.planx.uk/src/@planx/components/Page/Editor.tsx index ac96bbe804..fd5eb2cadb 100644 --- a/editor.planx.uk/src/@planx/components/Page/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Page/Editor.tsx @@ -1,13 +1,25 @@ +import MenuItem from "@mui/material/MenuItem"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; import { useFormik } from "formik"; import React from "react"; +import ModalSection from "ui/editor/ModalSection"; +import ModalSectionContent from "ui/editor/ModalSectionContent"; +import RichTextInput from "ui/editor/RichTextInput"; +import SelectInput from "ui/editor/SelectInput"; +import Input from "ui/shared/Input"; +import InputRow from "ui/shared/InputRow"; +import InputRowItem from "ui/shared/InputRowItem"; +import InputRowLabel from "ui/shared/InputRowLabel"; -import { EditorProps } from "../ui"; +import { EditorProps, ICONS, InternalNotes, MoreInformation } from "../ui"; import { Page, parsePage } from "./model"; +import { ProposedAdvertisements } from "./schema/AdvertConsent"; type Props = EditorProps; -export default PageComponent; +export const PAGE_SCHEMAS = [ + { name: "Advert consent", schema: ProposedAdvertisements }, +] as const; function PageComponent(props: Props) { const formik = useFormik({ @@ -22,7 +34,75 @@ function PageComponent(props: Props) { return (