File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,24 @@ class ComponentTemplate extends React.Component {
76
76
< h2 id = { `${ metadata . displayName } -props` } >
77
77
< a href = { `#${ metadata . displayName } -props` } > Props</ a >
78
78
{ metadata . composes && (
79
- < small style = { { fontStyle : 'italic' , fontSize : '70%' } } >
80
- Accepts all props from{ ' ' }
81
- { metadata . composes
82
- . map ( p => `<${ p . replace ( './' , '' ) } >` )
83
- . join ( ', ' ) } { ' ' }
84
- unless otherwise noted.
85
- </ small >
79
+ < >
80
+ { ' ' }
81
+ < small style = { { fontStyle : 'italic' , fontSize : '70%' } } >
82
+ Accepts all props from{ ' ' }
83
+ { metadata . composes
84
+ . map ( p => (
85
+ < code key = { p } > { `<${ p . replace ( './' , '' ) } >` } </ code >
86
+ ) )
87
+ . reduce ( ( acc , el , i ) => {
88
+ acc . push ( el ) ;
89
+ if ( i < metadata . composes . length - 1 ) {
90
+ acc . push ( ', ' ) ;
91
+ }
92
+ return acc ;
93
+ } , [ ] ) } { ' ' }
94
+ unless otherwise noted.
95
+ </ small >
96
+ </ >
86
97
) }
87
98
</ h2 >
88
99
{ metadata . props . map ( p => this . renderProp ( p , metadata . displayName ) ) }
You can’t perform that action at this time.
0 commit comments