File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ const ButtonGroup = styled.div`
60
60
export const Preview : FC < PropsWithChildren < PreviewProps > > = ( props ) => {
61
61
const { themePkg, mode } = props ;
62
62
const { mdData } = useMdData ( props . path ) ;
63
- const childs = Children . toArray ( props . children ) ;
64
63
const [ previewDoc , setPreviewDoc ] = useState < PreviewProps [ 'preview' ] > ( props . preview || 'example' ) ;
65
64
const themePkgNmae = ! ! mode ? themePkg ?. replace ( / - ( l i g h t | d a r k ) $ / , '' ) : themePkg ;
66
65
const themeName = themePkgNmae ?. replace ( '@uiw/codemirror-theme-' , '' ) . replace ( '-' , ' ' ) ;
@@ -91,9 +90,6 @@ export const Preview: FC<PropsWithChildren<PreviewProps>> = (props) => {
91
90
< PreCode value = { `npm install ${ themePkg } --save` } />
92
91
</ Header >
93
92
) }
94
- { childs . map ( ( child , key ) => {
95
- return cloneElement ( child as any , { key, source : mdData ?. source } ) ;
96
- } ) }
97
93
{ mdData && ( previewDoc === 'document' || ! themePkg ) && < Markdown source = { mdData . source } mdData = { mdData } /> }
98
94
{ previewDoc === 'example' && themePkg && themeExtensionName && < Sample theme = { extension } /> }
99
95
</ Content >
Original file line number Diff line number Diff line change @@ -9,14 +9,14 @@ const Pre = styled.pre`
9
9
border-radius : 5px ;
10
10
` ;
11
11
12
- const Span = styled . span < { number : number } > `
12
+ const Span = styled . span < { $ number : number } > `
13
13
${ ( props ) =>
14
- props . number === 0 &&
14
+ props . $ number === 0 &&
15
15
css `
16
16
color : var (--color-accent-emphasis );
17
17
` }
18
18
${ ( props ) =>
19
- props . number === 2 &&
19
+ props . $ number === 2 &&
20
20
css `
21
21
color : var (--color-danger-fg );
22
22
` }
@@ -27,7 +27,7 @@ export const PreCode: FC<PropsWithoutRef<{ value?: string }>> = ({ value = '' })
27
27
< Pre >
28
28
{ value . split ( ' ' ) . map ( ( str , idx ) => {
29
29
return (
30
- < Span key = { idx } number = { idx } >
30
+ < Span key = { idx } $ number= { idx } >
31
31
{ str } { ' ' }
32
32
</ Span >
33
33
) ;
You can’t perform that action at this time.
0 commit comments