From 898a0bb4a4cb26e51366cc95a50e55b6f1f1de60 Mon Sep 17 00:00:00 2001 From: Shunya Hayashi <70781900+devshun@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:46:27 +0900 Subject: [PATCH] feat(web): plugin playground/enable edit html with modal (#1236) Co-authored-by: lby --- .../PluginPlayground/Code/HtmlEditModal.tsx | 60 +++++++++++++++ .../features/PluginPlayground/Code/index.tsx | 74 ++++++++++++------- .../features/PluginPlayground/Code/utils.ts | 30 ++++++++ 3 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx create mode 100644 web/src/beta/features/PluginPlayground/Code/utils.ts diff --git a/web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx b/web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx new file mode 100644 index 0000000000..be1bc899be --- /dev/null +++ b/web/src/beta/features/PluginPlayground/Code/HtmlEditModal.tsx @@ -0,0 +1,60 @@ +import { + Button, + CodeInput, + Modal, + ModalPanel +} from "@reearth/beta/lib/reearth-ui"; +import { styled } from "@reearth/services/theme"; +import { FC, useState } from "react"; + +type Props = { + isOpened: boolean; + sourceCode: string; + onClose: () => void; + onSubmit: (value: string) => void; +}; + +const HtmlEditModal: FC = ({ + isOpened, + onClose, + sourceCode, + onSubmit +}) => { + const [value, setValue] = useState(sourceCode); + return ( + + +