Browse Source

refactor: getPaginatedTitle -> getPageById

main
raunofreiberg 7 years ago
parent
commit
01f780cf00
  1. 9
      src/components/MarkdownPage/MarkdownPage.js

9
src/components/MarkdownPage/MarkdownPage.js

@ -31,10 +31,7 @@ type Props = {
titlePostfix: string, titlePostfix: string,
}; };
const getPaginatedTitle = ( const getPageById = (sectionList: Array<Object>, templateFile: ?string) => {
sectionList: Array<Object>,
templateFile: ?string,
) => {
if (!templateFile) { if (!templateFile) {
return null; return null;
} }
@ -60,8 +57,8 @@ const MarkdownPage = ({
const hasAuthors = authors.length > 0; const hasAuthors = authors.length > 0;
const titlePrefix = markdownRemark.frontmatter.title || ''; const titlePrefix = markdownRemark.frontmatter.title || '';
const prev = getPaginatedTitle(sectionList, markdownRemark.frontmatter.prev); const prev = getPageById(sectionList, markdownRemark.frontmatter.prev);
const next = getPaginatedTitle(sectionList, markdownRemark.frontmatter.next); const next = getPageById(sectionList, markdownRemark.frontmatter.next);
return ( return (
<Flex <Flex

Loading…
Cancel
Save