@bbc/psammead-timestamp-container
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -6,2 +6,3 @@ # Psammead Timestamp Container Changelog | ||
|---------|-------------| | ||
| 2.2.0 | [PR#1245](https://github.com/bbc/psammead/pull/1245) The storybook stories now include the ability to change the service | | ||
| 2.1.0 | [PR#1233](https://github.com/bbc/psammead/pull/1233) Add ESM modules entry | | ||
@@ -8,0 +9,0 @@ | 2.0.0 | [PR#1182](https://github.com/bbc/psammead/pull/1182) Add `service` prop and use `gel-foundations@3.0.3`, `psammead-timestamp@2.0.4`, `psammead-test-helpers@1.0.2` | |
{ | ||
"name": "@bbc/psammead-timestamp-container", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "dist/index.js", | ||
@@ -33,2 +33,3 @@ "module": "esm/index.js", | ||
"devDependencies": { | ||
"@bbc/psammead-storybook-helpers": "^3.3.0", | ||
"@bbc/psammead-test-helpers": "^1.0.2", | ||
@@ -35,0 +36,0 @@ "react": "^16.8.6" |
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; // eslint-disable-line import/no-extraneous-dependencies | ||
import { latin } from '@bbc/gel-foundations/scripts'; | ||
import { withKnobs, text, number, boolean } from '@storybook/addon-knobs'; | ||
import { dirDecorator } from '@bbc/psammead-storybook-helpers'; | ||
import Timestamp from '.'; | ||
@@ -9,3 +9,4 @@ | ||
.addDecorator(withKnobs) | ||
.add('default', () => ( | ||
.addDecorator(dirDecorator) | ||
.add('default', ({ service, script }) => ( | ||
<Timestamp | ||
@@ -16,7 +17,7 @@ timestamp={number('Unix timestamp', 1530947227000)} | ||
isRelative={boolean('isRelative', false)} | ||
script={latin} | ||
service="news" | ||
script={script} | ||
service={service} | ||
/> | ||
)) | ||
.add('with prefix', () => ( | ||
.add('with prefix', ({ service, script }) => ( | ||
<Timestamp | ||
@@ -28,7 +29,7 @@ timestamp={number('Unix timestamp', 1552666749637)} | ||
prefix={text('Prefix text', 'Updated')} | ||
script={latin} | ||
service="news" | ||
script={script} | ||
service={service} | ||
/> | ||
)) | ||
.add('with prefix and suffix', () => ( | ||
.add('with prefix and suffix', ({ service, script }) => ( | ||
<Timestamp | ||
@@ -41,7 +42,7 @@ timestamp={number('Unix timestamp', 1530947227000)} | ||
suffix={text('Suffix text', 'is date of last update')} | ||
script={latin} | ||
service="news" | ||
script={script} | ||
service={service} | ||
/> | ||
)) | ||
.add('with locale', () => ( | ||
.add('with locale', ({ service, script, locale }) => ( | ||
<Timestamp | ||
@@ -52,6 +53,6 @@ timestamp={number('Unix timestamp', 1530947227000)} | ||
isRelative={boolean('isRelative', false)} | ||
script={latin} | ||
locale={text('Locale', 'fa')} | ||
service="persian" | ||
script={script} | ||
locale={locale} | ||
service={service} | ||
/> | ||
)); |
32736
700
3