/** * Copyright (c) 2013-present, Facebook, Inc. * * @emails react-core * @flow */ import Container from 'components/Container'; import Flex from 'components/Flex'; import MarkdownHeader from 'components/MarkdownHeader'; import NavigationFooter from 'templates/components/NavigationFooter'; import React from 'react'; import StickyResponsiveSidebar from 'components/StickyResponsiveSidebar'; import TitleAndMetaTags from 'components/TitleAndMetaTags'; import findSectionForPath from 'utils/findSectionForPath'; import toCommaSeparatedList from 'utils/toCommaSeparatedList'; import {sharedStyles} from 'theme'; import createOgUrl from 'utils/createOgUrl'; import type {Node} from 'types'; type Props = { authors: Array, createLink: Function, // TODO: Add better flow type once we Flow-type createLink date?: string, enableScrollSync?: boolean, ogDescription: string, location: Location, markdownRemark: Node, sectionList: Array, // TODO: Add better flow type once we have the Section component titlePostfix: string, }; const MarkdownPage = ({ authors = [], createLink, date, enableScrollSync, ogDescription, location, markdownRemark, sectionList, titlePostfix = '', }: Props) => { const hasAuthors = authors.length > 0; const titlePrefix = markdownRemark.frontmatter.title || ''; return (
{(date || hasAuthors) && (
{date}{' '} {hasAuthors && ( by{' '} {toCommaSeparatedList(authors, author => ( {author.frontmatter.name} ))} )}
)}
{markdownRemark.fields.path && ( )}
{/* TODO Read prev/next from index map, not this way */} {(markdownRemark.frontmatter.next || markdownRemark.frontmatter.prev) && ( )} ); }; export default MarkdownPage;