/** * Copyright (c) 2017-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* eslint-disable */ import React from 'react'; import {Link} from 'react-router-dom'; import Helmet from 'react-helmet'; import classnames from 'classnames'; import Layout from '@theme/Layout'; // eslint-disable-line import styles from './styles.module.css'; export default class BlogPost extends React.Component { renderPostHeader() { const {metadata, siteConfig} = this.props; const {baseUrl} = siteConfig; const { date, author, authorURL, authorTitle, authorFBID, permalink, title, } = metadata; const blogPostDate = new Date(date); const month = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ]; const authorImageURL = authorFBID ? `https://graph.facebook.com/${authorFBID}/picture/?height=200&width=200` : metadata.authorImageURL; return ( {title} {month[blogPostDate.getMonth()]} {blogPostDate.getDay()},{' '} {blogPostDate.getFullYear()} {author ? ( {author} {authorTitle} ) : null} {authorImageURL && ( )}{' '} ); } render() { const {metadata, children, siteConfig} = this.props; const {language} = metadata; return ( {language && } {this.renderPostHeader()} {children} ); } }
{month[blogPostDate.getMonth()]} {blogPostDate.getDay()},{' '} {blogPostDate.getFullYear()}
{author} {authorTitle}