Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Add story containing inline link to Paragraph #746

Merged
merged 11 commits into from
Jul 4, 2019
1 change: 1 addition & 0 deletions packages/components/psammead-paragraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.0.7 | [PR#746](https://github.com/bbc/psammead/pull/746) Use `@bbc/[email protected]` and add a 'with inline link' story |
pjlee11 marked this conversation as resolved.
Show resolved Hide resolved
| 1.0.6 | [PR#713](https://github.com/bbc/psammead/pull/713) Update `styled-components` to 4.3.2 |
| 1.0.5 | [PR#677](https://github.com/bbc/psammead/pull/677) Use `@bbc/[email protected]` |
| 1.0.4 | [PR#498](https://github.com/bbc/psammead/pull/498) Update stories to use new input provider |
Expand Down
19 changes: 18 additions & 1 deletion packages/components/psammead-paragraph/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/components/psammead-paragraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-paragraph",
"version": "1.0.6",
"version": "1.0.7",
"description": "React styled component for a Paragraph",
"main": "dist/index.js",
"repository": {
Expand All @@ -26,6 +26,7 @@
"@bbc/psammead-styles": "^0.3.2"
},
"devDependencies": {
"@bbc/psammead-inline-link": "1.1.0",
"@bbc/psammead-storybook-helpers": "^2.0.0",
"@bbc/psammead-test-helpers": "^0.3.3",
"react": "^16.8.6",
Expand Down
15 changes: 15 additions & 0 deletions packages/components/psammead-paragraph/src/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { inputProvider } from '@bbc/psammead-storybook-helpers';
import InlineLink from '@bbc/psammead-inline-link';
import notes from '../README.md';
import Paragraph from './index';

Expand All @@ -13,4 +14,18 @@ storiesOf('Components|Paragraph', module)
<Paragraph script={script}>{paragraph}</Paragraph>
)),
{ notes, knobs: { escapeHTML: false } },
)
.add(
'containing an inline link',
inputProvider(
[{ name: 'Paragraph' }, { name: 'Inline link' }],
([paragraph, linkText], script) => (
<Paragraph script={script}>
{`${paragraph} `}
<InlineLink href="https://www.bbc.com">{linkText}</InlineLink>
{` ${paragraph}`}
</Paragraph>
),
),
{ notes, knobs: { escapeHTML: false } },
);