Skip to content

Commit dd27d7c

Browse files
committed
Clearly show how components should be imported
1 parent 93d9d4d commit dd27d7c

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.storybook/customTheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { create } from "@storybook/theming";
22

33
const brandImage= "logo.png";
44
const brandTitle= "@codegouvfr/react-dsfr";
5-
const brandUrl= "https://github.com/@codegouvfr/react-dsfr";
5+
const brandUrl= "https://github.com/codegouvfr/react-dsfr";
66
const fontBase= '"Marianne", arial, sans-serif';
77
const fontCode= "monospace";
88

docs/getStory.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,19 @@ export function getStoryFactory<Props extends Record<string, any>>(params: {
120120
return out;
121121
}
122122

123+
const componentName = symToStr(wrappedComponent);
124+
123125
return {
124126
"meta": id<Meta>({
125-
"title": `${sectionName}/${symToStr(wrappedComponent)}`,
127+
"title": `${sectionName}/${componentName}`,
126128
"component": Component,
127129
"parameters": {
128130
"docs": {
129131
"description": {
130-
"component": description
132+
"component": [
133+
`\`import { ${componentName} } from "@codegouvfr/react-dsfr/${componentName}"\``,
134+
...(description === undefined ? [] : [description])
135+
].join(" \n")
131136
}
132137
}
133138
},

docs/sectionName.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const sectionName = "sandbox";
1+
export const sectionName = "components";

0 commit comments

Comments
 (0)