From e643cf26d4932eaadb9eaa07ef2aafa416089adc Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Fri, 16 Dec 2022 11:38:34 +0000 Subject: [PATCH] Made typescript the default language for the codeBlock component --- apps/webapp/app/components/CreateNewWorkflow.tsx | 4 ++-- apps/webapp/app/components/code/codeBlock.tsx | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/webapp/app/components/CreateNewWorkflow.tsx b/apps/webapp/app/components/CreateNewWorkflow.tsx index 023899fde..efe3e5fc7 100644 --- a/apps/webapp/app/components/CreateNewWorkflow.tsx +++ b/apps/webapp/app/components/CreateNewWorkflow.tsx @@ -1,7 +1,7 @@ import Prism from "prismjs"; import "prismjs/components/prism-typescript"; import { useEffect } from "react"; -import CodeBlock from "./code/codeBlock"; +import CodeBlock from "./code/CodeBlock"; import { Header1 } from "./primitives/text/Headers"; export default function CreateNewWorkflow() { @@ -11,7 +11,7 @@ export default function CreateNewWorkflow() { return ( <> Create a Workflow - + ); } diff --git a/apps/webapp/app/components/code/codeBlock.tsx b/apps/webapp/app/components/code/codeBlock.tsx index 79c3e67da..89139d41a 100644 --- a/apps/webapp/app/components/code/codeBlock.tsx +++ b/apps/webapp/app/components/code/codeBlock.tsx @@ -3,10 +3,13 @@ import Prism from "prismjs"; type CodeBlockProps = { code: string; - language: string; + language?: string; }; -export default function CodeBlock({ code, language }: CodeBlockProps) { +export default function CodeBlock({ + code, + language = "typescript", +}: CodeBlockProps) { useEffect(() => { Prism.highlightAll(); }, []);