chore: better examples

This commit is contained in:
endiliey 2018-08-26 03:11:28 +08:00
parent d3e12c9455
commit be3d259ac8
18 changed files with 619 additions and 174 deletions

27
lib/theme/Layout/index.js Normal file
View 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>
);
}
}