Skip to content

Commit 73cced5

Browse files
committedSep 1, 2023
website: fix example.
1 parent dda529b commit 73cced5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed
 

‎www/src/pages/theme/home/index.tsx

+10-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Counter = () => {
5151
);
5252
};`;
5353

54-
const CodeEditor = styled(CodeMirror)`
54+
const CodeEditor = styled.div`
5555
border-radius: 0.375rem;
5656
overflow: hidden;
5757
position: relative;
@@ -75,16 +75,19 @@ export function Component() {
7575
.join('-')
7676
.replace(/-light$/, '/light')
7777
.replace(/-dark$/, '/dark');
78+
const themeExtension = themeData[name as keyof typeof themeData];
7879
return (
7980
<Link key={idx} to={`/theme/data/${linkName}`}>
8081
<ThemeCard>
8182
<Title>{toTitleCase(name)}</Title>
82-
<CodeEditor
83-
value={codeString}
84-
height="185px !important"
85-
theme={themeData[name as keyof typeof themeData]}
86-
extensions={[color, langs.jsx()]}
87-
/>
83+
<CodeEditor>
84+
<CodeMirror
85+
theme={themeExtension}
86+
value={codeString}
87+
height="185px !important"
88+
extensions={[color, langs.jsx()]}
89+
/>
90+
</CodeEditor>
8891
</ThemeCard>
8992
</Link>
9093
);

0 commit comments

Comments
 (0)
Please sign in to comment.