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

Commit

Permalink
Merge pull request #2457 from bbc/sitewide-links-bug
Browse files Browse the repository at this point in the history
Fix storybook bug for Sitewide Links
  • Loading branch information
OlgaLyubin authored Oct 23, 2019
2 parents e22c13c + fce55c8 commit d1a7ef3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/components/psammead-sitewide-links/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 3.1.17 | [PR#2457](https://github.com/bbc/psammead/pull/2457) Show relevant link text when selecting service in storybook |
| 3.1.16 | [PR#2440](https://github.com/bbc/psammead/pull/2440) Talos - Bump Dependencies - @bbc/psammead-styles |
| 3.1.15 | [PR#2404](https://github.com/bbc/psammead/pull/2404) replace inputProvider and dirDecorator with withServicesInput |
| 3.1.14 | [PR#2351](https://github.com/bbc/psammead/pull/2351) Fix styling for IE11 |
Expand Down

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

2 changes: 1 addition & 1 deletion packages/components/psammead-sitewide-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-sitewide-links",
"version": "3.1.16",
"version": "3.1.17",
"description": "React styled component for a sitewide-links",
"main": "dist/index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ const buildLink = text => ({
href: 'https://www.bbc.co.uk/news',
});

const links = Array(7)
.fill()
.map((el, n) => `link ${n}`)
.map(buildLink);
const links = (text, service) =>
Array(7)
.fill()
.map((el, n) => (service === 'news' ? `link ${n}` : `${text} ${n}`))
.map(buildLink);

storiesOf('Components|SitewideLinks', module)
.addDecorator(withKnobs)
Expand All @@ -22,7 +23,7 @@ storiesOf('Components|SitewideLinks', module)
'default',
({ text, service }) => (
<SitewideLinks
links={links}
links={links(text, service)}
copyrightText={service === 'news' ? 'copyright text' : text}
externalLink={buildLink(service === 'news' ? 'external link' : text)}
service={service}
Expand Down

0 comments on commit d1a7ef3

Please sign in to comment.