Advertisement
conradlin

newsItem.js

May 4th, 2020
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from "react"
  2. import { Link } from "gatsby";
  3.  
  4. export default ({ data }) => {
  5.     const { title, tags, cover_image, publish_date, desc, read_time, url, slug } = data
  6.  
  7.     return (
  8.         <div style={{ margin: 10 }}>        
  9.             <Link to={`subscribe/posts/${url}/`}>
  10.               <div style = {{color: "grey"}}>Tags: {tags && tags.join(', ')} • Published: {publish_date}{read_time} MIN READ</div>
  11.               <h2>{title}</h2>
  12.               <p style = {{ color: "black" }} dangerouslySetInnerHTML={{ __html: desc }}></p>
  13.             </Link>
  14.         </div>
  15.     )
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement