@financial-times/x-live-blog-post
Advanced tools
Comparing version 2.0.6 to 2.1.0
{ | ||
"name": "@financial-times/x-live-blog-post", | ||
"version": "2.0.6", | ||
"version": "2.1.0", | ||
"description": "", | ||
@@ -20,3 +20,3 @@ "main": "dist/LiveBlogPost.cjs.js", | ||
"dependencies": { | ||
"@financial-times/x-engine": "^2.0.6" | ||
"@financial-times/x-engine": "^2.1.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withKnobs, text, boolean } from '@storybook/addon-knobs' | ||
import { LiveBlogPost } from '../src/LiveBlogPost' | ||
const defaultProps = { | ||
id: 12345, | ||
export default { | ||
title: 'x-live-blog-post', | ||
parameters: { | ||
escapeHTML: false | ||
} | ||
} | ||
export const ContentBody = (args) => { | ||
return <LiveBlogPost {...args} /> | ||
} | ||
ContentBody.args = { | ||
title: 'Turkey’s virus deaths may be 25% higher than official figure', | ||
isBreakingNews: false, | ||
bodyHTML: | ||
'<p>Turkey’s death toll from coronavirus could be as much as 25 per cent higher than the government’s official tally, adding the country of 83m people to the raft of nations that have struggled to accurately capture the impact of the pandemic.</p>\n<p>Ankara has previously rejected suggestions that municipal data from Istanbul, the epicentre of the country’s Covid-19 outbreak, showed that there were more deaths from the disease than reported.</p>\n<p>But an analysis of individual death records by the Financial Times raises questions about the Turkish government’s explanation for a spike in all-cause mortality in the city of almost 16m people.</p>\n<p><a href="https://www.ft.com/content/80bb222c-b6eb-40ea-8014-563cbe9e0117" target="_blank">Read the article here</a></p>\n<p><img class="picture" src="http://blogs.ft.com/the-world/files/2020/05/istanbul_excess_morts_l.jpg"></p>', | ||
isBreakingNews: false, | ||
id: '12345', | ||
publishedDate: '2020-05-13T18:52:28.000Z', | ||
@@ -16,30 +25,1 @@ articleUrl: 'https://www.ft.com/content/2b665ec7-a88f-3998-8f39-5371f9c791ed', | ||
} | ||
const toggleTitle = () => text('Title', defaultProps.title) | ||
const toggleShowBreakingNews = () => boolean('Show breaking news', defaultProps.isBreakingNews) | ||
const toggleContent = () => text('Body HTML', defaultProps.bodyHTML) | ||
const togglePostId = () => text('ID', defaultProps.id) | ||
const togglePublishedTimestamp = () => text('Published date', defaultProps.publishedDate) | ||
const toggleArticleUrl = () => text('Article URL', defaultProps.articleUrl) | ||
const toggleShowShareButtons = () => boolean('Show share buttons', defaultProps.showShareButtons) | ||
storiesOf('x-live-blog-post', module) | ||
.addDecorator(withKnobs) | ||
.addParameters({ | ||
knobs: { | ||
escapeHTML: false | ||
} | ||
}) | ||
.add('Content Body', () => { | ||
const knobs = { | ||
title: toggleTitle(), | ||
isBreakingNews: toggleShowBreakingNews(), | ||
bodyHTML: toggleContent(), | ||
id: togglePostId(), | ||
publishedDate: togglePublishedTimestamp(), | ||
articleUrl: toggleArticleUrl(), | ||
showShareButtons: toggleShowShareButtons() | ||
} | ||
return <LiveBlogPost {...defaultProps} {...knobs} /> | ||
}) |
1473340
14452