From 24e2d4b1f4f542fec3e4eccee43eabb62fdcf58b Mon Sep 17 00:00:00 2001 From: Shrilakshmi Shastry Date: Sat, 10 Aug 2024 13:52:25 +0530 Subject: [PATCH 1/2] feat: add playground --- components/CodeBlock/CodeBlock.module.css | 3 - components/ContentTemplates/FormsTemplate.tsx | 25 + components/Playground/Playground.module.css | 3 + components/Playground/Playground.tsx | 25 + package-lock.json | 1185 ++++++++++++++--- package.json | 3 + utils.ts | 20 + 7 files changed, 1074 insertions(+), 190 deletions(-) create mode 100644 components/Playground/Playground.module.css create mode 100644 components/Playground/Playground.tsx diff --git a/components/CodeBlock/CodeBlock.module.css b/components/CodeBlock/CodeBlock.module.css index 1e68c87..6473b44 100644 --- a/components/CodeBlock/CodeBlock.module.css +++ b/components/CodeBlock/CodeBlock.module.css @@ -13,8 +13,6 @@ overflow-x: auto; } - - .codeLanguage { background-color: var(--dark); padding: 8px; @@ -37,4 +35,3 @@ width: 70vw; } } - diff --git a/components/ContentTemplates/FormsTemplate.tsx b/components/ContentTemplates/FormsTemplate.tsx index a91d208..07d1828 100644 --- a/components/ContentTemplates/FormsTemplate.tsx +++ b/components/ContentTemplates/FormsTemplate.tsx @@ -1,8 +1,14 @@ +import dynamic from "next/dynamic" import { formsPageNavigation } from "../../data/pageNavigationLists" import { CodeBlock } from "../CodeBlock/CodeBlock" import { NavPage } from "../NavPage/NavPage" import { PageUpdated } from "../PageUpdated/PageUpdated" import { TemplateSection } from "../TemplateSection/TemplateSection" +import { formatCss, formatHtml } from "../../utils" + +const Playground = dynamic(() => import("../Playground/Playground"), { + ssr: false, +}) export const FormsTemplate = () => { return ( @@ -216,6 +222,25 @@ export const FormsTemplate = () => { screen reader user.

+ + + + + + +`), + }, + "/Wrapper.css": { + code: formatCss(`form{ color:blue;} `), + }, + }} + /> +