forked from COVID19Tracking/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request COVID19Tracking#176 from COVID19Tracking/add-gatsb…
…y-press-js Add component for press links
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import { Link } from 'gatsby' | ||
|
||
export const PressList = ({ press }) => ( | ||
<ul> | ||
{press.map(({ node }) => ( | ||
<li key={`press-${node.id}`}> | ||
<Link to={node.url}>{node.title}</Link>, {node.publication}, {node.publishDate} | ||
</li> | ||
))} | ||
</ul> | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react' | ||
import { PressList } from '../components/common/press' | ||
|
||
export default { | ||
title: 'Press Links', | ||
} | ||
|
||
export const regular = () => <PressList press={dummyData.allCovidPress.edges}/> | ||
|
||
const dummyData = { | ||
"allCovidPress": { | ||
"edges": [ | ||
{ | ||
"node": { | ||
"title": "Coronavirus update: 392,870 cases globally, 17,159 deaths, Italy shows glimmer of hope and NYC remains U.S. epicenter", | ||
"url": "https://www.marketwatch.com/story/coronavirus-update-392870-cases-globally-17159-deaths-italy-shows-glimmer-of-hope-and-nyc-remains-us-epicenter-2020-03-24?siteid=yhoof2&yptr=yahoo", | ||
"publishDate": "24 March 2020", | ||
"id": "e0b4614e-ad97-5d0f-9cde-582b88c815ff", | ||
"publication": "MarketWatch" | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"title": "Comparing COVID-19 in Minnesota and its neighbors in Upper Midwest", | ||
"url": "https://www.mprnews.org/story/2020/03/17/comparing-covid19-in-minnesota-and-its-neighbors-in-upper-midwest", | ||
"publishDate": "23 March 2020", | ||
"id": "72d7dbae-24b3-5253-8a3e-9bbbe54d23f7", | ||
"publication": "Minnesota Public Radio" | ||
} | ||
}, | ||
{ | ||
"node": { | ||
"title": "Coronavirus cases top 300,000 worldwide as US becomes one of worst hit countries", | ||
"url": "https://www.cnbc.com/2020/03/21/coronavirus-cases-top-300000-worldwide-as-us-becomes-one-of-worst-hit.html", | ||
"publishDate": "21 March 2020", | ||
"id": "a5ecabb4-c79a-58d3-b85e-e54035471d25", | ||
"publication": "CNBC" | ||
} | ||
} | ||
] | ||
} | ||
} |