mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 19:48:54 +02:00
v2: prepare to move
This commit is contained in:
parent
dc7ef96849
commit
45736200b0
172 changed files with 0 additions and 0 deletions
29
v2/lib/theme/Layout/index.js
Normal file
29
v2/lib/theme/Layout/index.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
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() {
|
||||
const {children, pagesMetadatas, docsMetadatas = {}, location} = this.props;
|
||||
const docsLinks = Object.values(docsMetadatas).map(data => ({
|
||||
path: `${data.permalink}`
|
||||
}));
|
||||
const routeLinks = [...pagesMetadatas, ...docsLinks].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>
|
||||
);
|
||||
}
|
||||
}
|
39
v2/lib/theme/Layout/styles.css
Normal file
39
v2/lib/theme/Layout/styles.css
Normal file
|
@ -0,0 +1,39 @@
|
|||
.footer {
|
||||
color: #777;
|
||||
margin-top: 30px;
|
||||
padding: 10px 15px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.routeLinks {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.routeLinks li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.routeLinks li a {
|
||||
color: inherit;
|
||||
margin: 3px;
|
||||
padding: 3px 7px;
|
||||
text-decoration: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.routeLinks li a.selected,
|
||||
.routeLinks li a:hover {
|
||||
border-color: rgba(175, 47, 47, 0.1);
|
||||
}
|
||||
|
||||
.routeLinks li a.selected {
|
||||
border-color: rgba(175, 47, 47, 0.2);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue