mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 10:22:30 +02:00
chore: nits
This commit is contained in:
parent
85f0fd69c0
commit
15a810fee5
3 changed files with 12 additions and 18 deletions
|
@ -102,9 +102,7 @@ async function loadDocs({siteDir, docsDir, env, siteConfig}) {
|
|||
})
|
||||
);
|
||||
|
||||
/*
|
||||
Get the titles of the previous and next ids so that we can use them
|
||||
*/
|
||||
/* Get the titles of the previous and next ids so that we can use them */
|
||||
Object.keys(docsMetadatas).forEach(currentID => {
|
||||
const previousID = idx(docsMetadatas, [currentID, 'previous']);
|
||||
if (previousID) {
|
||||
|
|
|
@ -22,16 +22,19 @@ export default class Docs extends React.Component {
|
|||
{thisSidebar[categoryName].map(rawLinkID => {
|
||||
const linkID = (language ? `${language}-` : '') + rawLinkID;
|
||||
const linkMetadata = docsMetadatas[linkID];
|
||||
if (!linkMetadata) {
|
||||
throw new Error(
|
||||
`Improper sidebars.json file, document with id '${linkID}' not found.`
|
||||
);
|
||||
}
|
||||
const linkClassName =
|
||||
linkID === thisID ? 'navListItemActive' : 'navListItem';
|
||||
return (
|
||||
linkMetadata && (
|
||||
<li className={linkClassName} key={linkID}>
|
||||
<Link className="navItem" to={linkMetadata.permalink}>
|
||||
{linkMetadata.sidebar_label || linkMetadata.title}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
|
|
|
@ -2,14 +2,7 @@ import React from 'react';
|
|||
|
||||
export default props => {
|
||||
if (props.error) {
|
||||
return (
|
||||
<div>
|
||||
Error!{' '}
|
||||
<button type="button" onClick={props.retry}>
|
||||
Retry
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
return <div align="center">Error 🔥🔥🔥</div>;
|
||||
}
|
||||
if (props.pastDelay) {
|
||||
return <div align="center">Loading...</div>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue