Skip to content

Commit

Permalink
fix(site): keep component names
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Mar 21, 2024
1 parent 3ca8f2d commit dbb74ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sharp-suits-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suid/site": patch
---

Keep component names
8 changes: 7 additions & 1 deletion packages/site/src/components/ComponentInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
Match,
Show,
Switch,
mergeProps,
} from "solid-js";
import ComponentCode from "~/components/ComponentCode";
import PageNav from "~/components/PageNav";
import PaperCode from "~/components/PaperCode";

export default function ComponentInfo(props: {
export default function ComponentInfo(inProps: {
name: string;
scope?: string;
body?: JSXElement;
Expand All @@ -34,6 +35,11 @@ export default function ComponentInfo(props: {
prevPage?: { text: string; href: string };
nextPage?: { text: string; href: string };
}) {
const props = mergeProps(inProps, {
get name() {
return inProps.name.replace(/\d+$/, "");
},
});
const name = createMemo(() => snakeCase(uncapitalize(props.name)));
const theme = useTheme();
const docsName = () => props.docsName ?? name();
Expand Down

0 comments on commit dbb74ae

Please sign in to comment.