File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
apps/web/src/app/(main)/onboarding/form Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ type CodeExampleStepProps = {
1616} ;
1717
1818export const CodeExampleStep = async ( { formId } : CodeExampleStepProps ) => {
19- const htmlCode = await highlightCode ( `<form
19+ const rawHtmlCode = `<form
2020 action="https://formbase.dev/s/${ formId ?? 'abcdefghijkl' } " method="POST"
2121 enctype="multipart/form-data"
2222 >
@@ -25,10 +25,9 @@ export const CodeExampleStep = async ({ formId }: CodeExampleStepProps) => {
2525 <textarea name="message"></textarea>
2626
2727 <button type="submit">Submit</button>
28- </form>` ) ;
28+ </form>` ;
2929
30- const reactCode =
31- await highlightCode ( `export default function FormbaseForm() {
30+ const rawReactCode = `export default function FormbaseForm() {
3231 return (
3332 <form
3433 action="https://formbase.dev/s/${ formId ?? 'abcdefghijkl' } "
@@ -42,7 +41,10 @@ export const CodeExampleStep = async ({ formId }: CodeExampleStepProps) => {
4241 <button type="submit">Submit</button>
4342 </form>
4443 );
45- }` ) ;
44+ }` ;
45+
46+ const htmlCode = await highlightCode ( rawHtmlCode ) ;
47+ const reactCode = await highlightCode ( rawReactCode ) ;
4648
4749 return (
4850 < div
@@ -68,7 +70,7 @@ export const CodeExampleStep = async ({ formId }: CodeExampleStepProps) => {
6870 } }
6971 />
7072 < CopyButton
71- text = { htmlCode }
73+ text = { rawHtmlCode }
7274 className = "absolute top-4 text-white right-4"
7375 />
7476 </ TabsContent >
@@ -80,7 +82,7 @@ export const CodeExampleStep = async ({ formId }: CodeExampleStepProps) => {
8082 } }
8183 />
8284 < CopyButton
83- text = { reactCode }
85+ text = { rawReactCode }
8486 className = "absolute top-4 text-white right-4"
8587 />
8688 </ TabsContent >
You can’t perform that action at this time.
0 commit comments