Skip to content

Commit d398a34

Browse files
committed
Fix Pre
1 parent 2084233 commit d398a34

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
import { Pre } from './pre';
3+
4+
const meta = {
5+
title: 'Pre',
6+
component: Pre,
7+
} satisfies Meta<typeof Pre>;
8+
9+
export default meta;
10+
type Story = StoryObj<typeof meta>;
11+
12+
export const Default: Story = {
13+
args: {
14+
children: `hello world`,
15+
},
16+
};
17+
18+
export const Markdown: Story = {
19+
args: {
20+
children: (
21+
<code
22+
data-language="js"
23+
data-theme="Firefox Light"
24+
style={{ display: 'grid' }}
25+
>
26+
<span data-line="">
27+
<span style={{ color: '#DD00A9' }}>import</span>
28+
<span style={{ color: '#4A4A4F' }}>{` {`}</span>
29+
<span style={{ color: '#0074E8' }}> Meta</span>
30+
<span style={{ color: '#939393' }}>, </span>
31+
<span style={{ color: '#0074E8' }}>Canvas</span>
32+
<span style={{ color: '#4A4A4F' }}>{` }`}</span>
33+
<span style={{ color: '#DD00A9' }}> from</span>
34+
<span style={{ color: '#003EAA' }}> '@storybook/blocks'</span>
35+
<span style={{ color: '#939393' }}>;</span>
36+
</span>
37+
<span data-line="">
38+
<span style={{ color: '#DD00A9' }}>import</span>
39+
<span style={{ color: '#4A4A4F' }}> *</span>
40+
<span style={{ color: '#DD00A9' }}> as</span>
41+
<span style={{ color: '#0074E8' }}> ButtonStories</span>
42+
<span style={{ color: '#DD00A9' }}> from</span>
43+
<span style={{ color: '#003EAA' }}> './Button.stories'</span>
44+
<span style={{ color: '#939393' }}>;</span>
45+
</span>
46+
<span data-line=""> </span>
47+
<span data-line="">
48+
<span style={{ color: '#767676' }}>&lt;</span>
49+
<span style={{ color: '#8000D7' }}>Meta</span>
50+
<span style={{ color: '#939393' }}> of</span>
51+
<span style={{ color: '#4A4A4F' }}>{`={`}</span>
52+
<span style={{ color: '#0074E8' }}>ButtonStories</span>
53+
<span style={{ color: '#4A4A4F' }}>{`}`}</span>
54+
<span style={{ color: '#767676' }}> /&gt;</span>
55+
</span>
56+
<span data-line=""> </span>
57+
<span data-line="">
58+
<span style={{ color: '#767676' }}>&lt;</span>
59+
<span style={{ color: '#8000D7' }}>Canvas</span>
60+
<span style={{ color: '#939393' }}> of</span>
61+
<span style={{ color: '#4A4A4F' }}>{`={`}</span>
62+
<span style={{ color: '#8000D7' }}>ButtonStories</span>
63+
<span style={{ color: '#4A4A4F' }}>.</span>
64+
<span style={{ color: '#058B00' }}>Primary</span>
65+
<span style={{ color: '#4A4A4F' }}>{`}`}</span>
66+
<span style={{ color: '#767676' }}> /&gt;</span>
67+
</span>
68+
</code>
69+
),
70+
},
71+
};

apps/frontpage/components/docs/mdx/pre.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import type { FC, ReactNode } from 'react';
24
import { CodeWrapper } from './code-snippets/wrapper';
35

@@ -6,6 +8,7 @@ interface PreProps {
68
}
79

810
export const Pre: FC<PreProps> = ({ children }) => {
11+
console.log(children);
912
return (
1013
<CodeWrapper>
1114
<pre>{children}</pre>

0 commit comments

Comments
 (0)