Skip to content

Commit

Permalink
WIP: Added simple table of contents.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj Dadela committed Nov 12, 2015
1 parent 1cc84fb commit bb024de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/Layout/Layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
font-size: 3rem;
font-weight: normal;
}

.tableOfContents {
/* TODO some box with position: fixed */
}
5 changes: 5 additions & 0 deletions src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export default class Layout extends Component {
return (
<div className={s.root}>
<h1 className={s.heading}>{title}</h1>
<ul className={s.tableOfContents}>
{components.map(component => (
<li><a href={'#' + component.name}>{component.name}</a></li>
))}
</ul>
<div>
<Components highlightTheme={highlightTheme} components={components}/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReactComponent/ReactComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default class ReactComponent extends Component {
render() {
let { component } = this.props;
return (
<div className={s.root}>
<h2 className={s.heading}>{component.name}</h2>
<div className={s.root} id={component.name}>
<h2 className={s.heading}><a href={'#' + component.name}>{component.name}</a></h2>
<div className={s.sourcePath}>{component.relativePath}</div>
{this.renderDescription()}
<Props props={component.props}/>
Expand Down

0 comments on commit bb024de

Please sign in to comment.