Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Feb 23, 2019
1 parent b4cf4d1 commit d6e8c16
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 42 deletions.
4 changes: 3 additions & 1 deletion v2/lib/load/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ module.exports = function loadConfig(siteDir, deleteCache = true) {
);
if (uselessFields && uselessFields.length > 0) {
throw new Error(
`The fields ${uselessFields.join(', ')} are not recognized in docusaurus.config.js`,
`The fields ${uselessFields.join(
', ',
)} are not recognized in docusaurus.config.js`,
);
}

Expand Down
54 changes: 26 additions & 28 deletions v2/lib/theme/DocsPaginator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,34 @@ function DocsPaginator() {
return (
<div className={styles.paginatorContainer}>
<div>
{metadata.previous &&
docsMetadatas[metadata.previous] && (
<Link
className={styles.paginatorLink}
to={docsMetadatas[metadata.previous].permalink}>
<svg className={styles.arrow} viewBox="0 0 24 24">
<g>
<line x1="19" y1="12" x2="5" y2="12" />
<polyline points="12 19 5 12 12 5" />
</g>
</svg>{' '}
<span className={styles.label}>{metadata.previous_title}</span>
</Link>
)}
{metadata.previous && docsMetadatas[metadata.previous] && (
<Link
className={styles.paginatorLink}
to={docsMetadatas[metadata.previous].permalink}>
<svg className={styles.arrow} viewBox="0 0 24 24">
<g>
<line x1="19" y1="12" x2="5" y2="12" />
<polyline points="12 19 5 12 12 5" />
</g>
</svg>{' '}
<span className={styles.label}>{metadata.previous_title}</span>
</Link>
)}
</div>
<div className={styles.paginatorRightContainer}>
{metadata.next &&
docsMetadatas[metadata.next] && (
<Link
className={styles.paginatorLink}
to={docsMetadatas[metadata.next].permalink}>
<span className={styles.label}>{metadata.next_title}</span>{' '}
<svg className={styles.arrow} viewBox="0 0 24 24">
<g>
<line x1="5" y1="12" x2="19" y2="12" />
<polyline points="12 5 19 12 12 19" />
</g>
</svg>
</Link>
)}
{metadata.next && docsMetadatas[metadata.next] && (
<Link
className={styles.paginatorLink}
to={docsMetadatas[metadata.next].permalink}>
<span className={styles.label}>{metadata.next_title}</span>{' '}
<svg className={styles.arrow} viewBox="0 0 24 24">
<g>
<line x1="5" y1="12" x2="19" y2="12" />
<polyline points="12 5 19 12 12 19" />
</g>
</svg>
</Link>
)}
</div>
</div>
);
Expand Down
23 changes: 10 additions & 13 deletions v2/website/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,16 @@ const QUOTES = [

function Home() {
const [featureIndex, setFeatureIndex] = useState(0);
useEffect(
() => {
const timer = window.setTimeout(() => {
setFeatureIndex(
prevFeatureIndex => (prevFeatureIndex + 1) % FEATURES.length,
);
}, FEATURE_INTERVAL);
return () => {
window.clearTimeout(timer);
};
},
[featureIndex],
);
useEffect(() => {
const timer = window.setTimeout(() => {
setFeatureIndex(
prevFeatureIndex => (prevFeatureIndex + 1) % FEATURES.length,
);
}, FEATURE_INTERVAL);
return () => {
window.clearTimeout(timer);
};
}, [featureIndex]);

return (
<div>
Expand Down

0 comments on commit d6e8c16

Please sign in to comment.