Commit dbb74ae 1 parent 3ca8f2d commit dbb74ae Copy full SHA for dbb74ae
File tree 2 files changed +12
-1
lines changed
packages/site/src/components
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @suid/site " : patch
3
+ ---
4
+
5
+ Keep component names
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import {
11
11
Match ,
12
12
Show ,
13
13
Switch ,
14
+ mergeProps ,
14
15
} from "solid-js" ;
15
16
import ComponentCode from "~/components/ComponentCode" ;
16
17
import PageNav from "~/components/PageNav" ;
17
18
import PaperCode from "~/components/PaperCode" ;
18
19
19
- export default function ComponentInfo ( props : {
20
+ export default function ComponentInfo ( inProps : {
20
21
name : string ;
21
22
scope ?: string ;
22
23
body ?: JSXElement ;
@@ -34,6 +35,11 @@ export default function ComponentInfo(props: {
34
35
prevPage ?: { text : string ; href : string } ;
35
36
nextPage ?: { text : string ; href : string } ;
36
37
} ) {
38
+ const props = mergeProps ( inProps , {
39
+ get name ( ) {
40
+ return inProps . name . replace ( / \d + $ / , "" ) ;
41
+ } ,
42
+ } ) ;
37
43
const name = createMemo ( ( ) => snakeCase ( uncapitalize ( props . name ) ) ) ;
38
44
const theme = useTheme ( ) ;
39
45
const docsName = ( ) => props . docsName ?? name ( ) ;
You can’t perform that action at this time.
0 commit comments