Skip to content

Commit af4fdc8

Browse files
author
Mikolaj Dadela
committed
Added "defined in file ..." information for the components.
1 parent f4e18e1 commit af4fdc8

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

loaders/styleguide.loader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function processComponent(filepath) {
1010
var hasExamples = !!fs.existsSync(examplesFile);
1111
return '{' + [
1212
'filepath: ' + JSON.stringify(filepath),
13+
'relativePath: ' + JSON.stringify(path.relative(config.rootDir, filepath)),
1314
'module: ' + requireIt(filepath),
1415
'props: ' + requireIt('!!props!' + filepath),
1516
'examples: ' + (hasExamples ? requireIt('examples!' + examplesFile) : null)

src/components/Layout/Layout.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77

88
.heading {
9-
margin-bottom: .5rem;
9+
margin-bottom: 2rem;
1010
font-size: 3rem;
1111
font-weight: normal;
1212
}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
.root {
2-
margin-bottom: 2rem;
2+
margin-bottom: 3rem;
33
}
44

55
.heading {
6-
margin-bottom: 1rem;
76
font-size: 2rem;
87
font-weight: normal;
98
}
109

10+
.sourcePath {
11+
color: #aaa;
12+
font-size: 0.8rem;
13+
margin-bottom: 1rem;
14+
font-family: monospace;
15+
}
16+
1117
.description {
1218
margin-bottom: 1rem;
1319
}

src/components/ReactComponent/ReactComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default class ReactComponent extends Component {
4646
return (
4747
<div className={s.root}>
4848
<h2 className={s.heading}>{component.name}</h2>
49+
<div className={s.sourcePath}>{component.relativePath}</div>
4950
{this.renderDescription()}
5051
<Props props={component.props}/>
5152
{this.renderExamples()}

0 commit comments

Comments
 (0)