mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
refactor(v2): extract out into standalone components (#1017)
This commit is contained in:
parent
a364aa531c
commit
e3d57d244b
6 changed files with 99 additions and 69 deletions
24
v2/lib/theme/DocsPaginator/index.js
Normal file
24
v2/lib/theme/DocsPaginator/index.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
import React from 'react';
|
||||
import {Link} from 'react-router-dom';
|
||||
|
||||
export default class DocsPaginator extends React.Component {
|
||||
render() {
|
||||
const {docsMetadatas, metadata} = this.props;
|
||||
return (
|
||||
<div>
|
||||
{metadata.previous &&
|
||||
docsMetadatas[metadata.previous] && (
|
||||
<Link to={docsMetadatas[metadata.previous].permalink}>
|
||||
<span>← {metadata.previous_title}</span>
|
||||
</Link>
|
||||
)}
|
||||
{metadata.next &&
|
||||
docsMetadatas[metadata.next] && (
|
||||
<Link to={docsMetadatas[metadata.next].permalink}>
|
||||
<span>{metadata.next_title} →</span>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue