mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 15:07:17 +02:00
chore: better examples
This commit is contained in:
parent
d3e12c9455
commit
be3d259ac8
18 changed files with 619 additions and 174 deletions
27
lib/theme/Layout/index.js
Normal file
27
lib/theme/Layout/index.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
import React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
import styles from './styles.css';
|
||||
|
||||
/* eslint-disable react/prefer-stateless-function */
|
||||
export default class Layout extends React.Component {
|
||||
render() {
|
||||
console.log(this.props);
|
||||
const {children, pagesData, docsData, location} = this.props;
|
||||
const routeLinks = [...pagesData, ...docsData].map(
|
||||
data =>
|
||||
data.path !== location.pathname && (
|
||||
<li key={data.path}>
|
||||
<Link to={data.path}>{data.path}</Link>
|
||||
</li>
|
||||
)
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
{children}
|
||||
<div className={styles.footer}>
|
||||
<ul className={styles.routeLinks}>{routeLinks}</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue