Created
June 26, 2019 18:04
-
-
Save sumitkharche/063f8835bd76505682914e23bfa2fe20 to your computer and use it in GitHub Desktop.
post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import {withRouteData} from 'react-static' | |
import Markdown from "react-markdown"; | |
import { Link } from 'components/Router' | |
export default withRouteData(({post}) => ( | |
<React.Fragment> | |
<div className="content"> | |
<Link to="/">{'<'} Back</Link> | |
</div> | |
<article> | |
<h1>{post.metadata.title}</h1> | |
<div> | |
<img | |
alt={post.metadata.title} | |
src={post.metadata.image.url} | |
/> | |
</div> | |
<Markdown source={post.metadata.content} /> | |
</article> | |
</React.Fragment> | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment