/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the CC-BY-4.0 license found * in the LICENSE file in the root directory of this source tree. * * @emails react-core */ 'use strict'; import Container from 'components/Container'; import Flex from 'components/Flex'; import Link from 'gatsby-link'; import PropTypes from 'prop-types'; import React from 'react'; import {colors, fonts, media} from 'theme'; const NavigationFooter = ({next, prev, location}) => { return (
{prev && (
Previous article
{linkToTitle(prev)}
)}
{next && (
Next article
{linkToTitle(next)}
)}
); }; NavigationFooter.propTypes = { next: PropTypes.string, prev: PropTypes.string, }; export default NavigationFooter; const linkToTitle = link => link.replace(/-/g, ' ').replace('.html', ''); const PrimaryLink = ({children, to, location}) => { // quick fix // TODO: replace this with better method of getting correct full url const updatedUrl = (location && location.pathname.replace(/\/[^/]+\.html/, '/' + to)) || to; return ( {children} ); }; const SecondaryLabel = ({children}) => (
{children}
);