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

Update Image to include AmpImg & add srcset prop #241

Merged
merged 35 commits into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ad9e964
Add AmpImg, update Image to include srcset prop
sareh Dec 20, 2018
7c9c707
Update Changelog
sareh Dec 20, 2018
943b219
Create AMP Storybook decorator
sareh Dec 20, 2018
93c344e
Use AmpStyles decorator for AmpImg stories, ensure height is passed i…
sareh Dec 21, 2018
bc4c8d9
Merge branch 'latest' into update-image-ampimg
sareh Dec 21, 2018
21b640f
Update Storybook link in Readme to Img variant.
sareh Dec 31, 2018
ea8d883
Update canonical link for AMP storybook decorator be BBC
sareh Dec 31, 2018
dc2908b
Merge branch 'latest' into update-image-ampimg
bcmn Jan 2, 2019
49714b7
Pull latest
Jan 4, 2019
5dad40b
Update package and lock
Jan 4, 2019
44549de
Update packages/components/psammead-image/README.md
ChrisBAshton Jan 4, 2019
594fcba
Update readme for code review comments
Jan 4, 2019
4b3f670
Update to dynamic fixture srcset
Jan 4, 2019
fe23764
Oh nooos thats not an array
Jan 4, 2019
58e6a9b
Primary src needs a size
Jan 4, 2019
b274c96
Update readme with srcset description
Jan 4, 2019
7546ea6
Update packages/components/psammead-image/README.md
ChrisBAshton Jan 4, 2019
a6d74bb
Update storybook decorator handling and fix fixtures
Jan 4, 2019
7ede465
Update snaps and readme
Jan 4, 2019
3a231bc
Merge branch 'update-image-ampimg' of github.com:BBC-News/psammead in…
Jan 4, 2019
425f4ad
Update README.md
Jan 4, 2019
48252b4
not sure why this is here
Jan 4, 2019
42bd7be
Update Readme
Jan 4, 2019
f67df76
Reset psammead-figure
Jan 4, 2019
1541929
Fix installation instruction
sareh Jan 7, 2019
3955a3d
Change attribution prop to be not required, update fixture data to pa…
sareh Jan 7, 2019
668c561
Merge branch 'latest' into update-image-ampimg
sareh Jan 7, 2019
b258c01
Moving Readme sections to match guidelines
sareh Jan 7, 2019
599c8f0
Merge branch 'latest' into update-image-ampimg
radiocontrolled Jan 8, 2019
3bc7f92
Merge branch 'latest' into update-image-ampimg
sareh Jan 8, 2019
1caa121
Merge branch 'latest' into update-image-ampimg
sareh Jan 9, 2019
d08f23a
Fix ratio of portrait image
sareh Jan 9, 2019
b34b7ae
Remove ratios from storybook titles - since inaccurate for the portra…
sareh Jan 9, 2019
ab5d1cf
Merge branch 'update-image-ampimg' of github.com:bbc-news/psammead in…
sareh Jan 9, 2019
15f0392
Merge branch 'latest' into update-image-ampimg
sareh Jan 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'storybook-readme/register';
import '@storybook/addon-options/register';
import '@storybook/addon-knobs/register'
import '@storybook/addon-viewport/register'
import '@storybook/addon-knobs/register';
31 changes: 25 additions & 6 deletions .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import { configure, addDecorator } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import styledNormalize from 'styled-normalize';
import { createGlobalStyle } from 'styled-components';
import {
AMP_SCRIPT,
AMP_NO_SCRIPT,
} from '@bbc/psammead-assets/amp-boilerplate';
import Helmet from 'react-helmet';

// Option defaults:
setOptions({
name: 'BBC Psammead',
url: 'https:github.com/BBC-News/psammead',
addonPanelInRight: true,
sidebarAnimations: true,
sortStoriesByKind: true,
});

function loadStories() {
require('glob-loader!./stories.pattern');
}

const GlobalStyle = createGlobalStyle`
${styledNormalize}

Expand Down Expand Up @@ -51,4 +52,22 @@ addDecorator(story => (
</Fragment>
));

configure(loadStories, module);
export const ampDecorator = story => (
<Fragment>
<Helmet htmlAttributes={{ amp: '' }}>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<link rel="canonical" href="https://bbc.com" />
<style amp-boilerplate="">{AMP_SCRIPT}</style>
<noscript>{`<style amp-boilerplate="">${AMP_NO_SCRIPT}</style>`}</noscript>
<script async src="https://cdn.ampproject.org/v0.js" />
</Helmet>
{story()}
</Fragment>
);

function loadAllStories() {
require('glob-loader!./stories.pattern');
}

configure(loadAllStories, module);
Loading