Skip to content

Commit

Permalink
use transformer as default
Browse files Browse the repository at this point in the history
  • Loading branch information
JSerZANP committed Jul 9, 2024
1 parent 216ed0c commit f04624d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 368 deletions.
22 changes: 0 additions & 22 deletions examples/web/app/snippet-transformer/page.tsx

This file was deleted.

12 changes: 1 addition & 11 deletions examples/web/components/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import { RiShareBoxLine } from "react-icons/ri";
import { defaultCode } from "remark-shaku-code-annotate";
import { Button, Column, Row, Text, View } from "./bare";

const CodeSnippetPreview = dynamic(() => import("./CodeSnippetPreview"), {
ssr: false,
});

const CodeSnippetPreviewTransformer = dynamic(
() => import("./CodeSnippetPreviewTransformer"),
{
Expand All @@ -26,11 +22,9 @@ const supportedLangs = Object.keys(defaultCode);
export function CodeSnippet({
code: _code,
lang: _lang,
useTransformer,
}: {
code?: string;
lang?: string;
useTransformer?: boolean;
}) {
const [lang, setLang] = useState<string>(_lang ?? "javascript");
const [code, setCode] = useState(_code ?? defaultCode[lang] ?? "");
Expand Down Expand Up @@ -114,11 +108,7 @@ export function CodeSnippet({
}}
/>
</Column>
{useTransformer ? (
<CodeSnippetPreviewTransformer code={code} lang={lang} />
) : (
<CodeSnippetPreview code={code} lang={lang} />
)}
<CodeSnippetPreviewTransformer code={code} lang={lang} />
</Row>
</Column>
);
Expand Down
335 changes: 0 additions & 335 deletions examples/web/components/CodeSnippetPreview.tsx

This file was deleted.

0 comments on commit f04624d

Please sign in to comment.