diff --git a/extensions/amp-twitter/0.1/storybook/Basic.amp.js b/extensions/amp-twitter/0.1/storybook/Basic.amp.js index c8f84600972c7..fea9199632ecc 100644 --- a/extensions/amp-twitter/0.1/storybook/Basic.amp.js +++ b/extensions/amp-twitter/0.1/storybook/Basic.amp.js @@ -15,7 +15,7 @@ */ import * as Preact from '../../../../src/preact'; -import {text, withKnobs} from '@storybook/addon-knobs'; +import {boolean, number, select, withKnobs} from '@storybook/addon-knobs'; import {withAmp} from '@ampproject/storybook-addon'; export default { @@ -33,9 +33,67 @@ export default { }; export const Default = () => { - const tweetId = text('tweet id', '1356304203044499462'); + const tweetId = select( + 'tweet id', + ['1356304203044499462', '495719809695621121', '463440424141459456'], + '1356304203044499462' + ); + const cards = boolean('show cards', true) ? undefined : 'hidden'; + const conversation = boolean('show conversation', false) ? undefined : 'none'; + return ( + + ); +}; + +export const Moments = () => { + const limit = number('limit to', 2); + return ( + + ); +}; + +export const Timelines = () => { + const tweetLimit = number('limit to', 5); + const timelineSourceType = select( + 'source type', + ['profile', 'likes', 'list', 'source', 'collection', 'url', 'widget'], + 'profile' + ); + const timelineScreenName = 'amphtml'; + const timelineUserId = '3450662892'; + return ( + + ); +}; + +export const DeletedTweet = () => { + const withFallback = boolean('include fallback?', true); return ( - +

In case you missed it last week, check out our recap of AMP in 2020 @@ -47,6 +105,31 @@ export const Default = () => { https://t.co/eaxT3MuSAK

+ {withFallback && ( +
+ An error occurred while retrieving the tweet. It might have been + deleted. +
+ )} +
+ ); +}; + +export const InvalidTweet = () => { + return ( + + ); }; diff --git a/extensions/amp-twitter/1.0/storybook/Basic.amp.js b/extensions/amp-twitter/1.0/storybook/Basic.amp.js index f4ff1f69f5674..504cd435204b4 100644 --- a/extensions/amp-twitter/1.0/storybook/Basic.amp.js +++ b/extensions/amp-twitter/1.0/storybook/Basic.amp.js @@ -15,7 +15,7 @@ */ import * as Preact from '../../../../src/preact'; -import {text, withKnobs} from '@storybook/addon-knobs'; +import {boolean, number, select, withKnobs} from '@storybook/addon-knobs'; import {withAmp} from '@ampproject/storybook-addon'; export default { @@ -34,9 +34,67 @@ export default { }; export const Default = () => { - const tweetId = text('tweet id', '1356304203044499462'); + const tweetId = select( + 'tweet id', + ['1356304203044499462', '495719809695621121', '463440424141459456'], + '1356304203044499462' + ); + const cards = boolean('show cards', true) ? undefined : 'hidden'; + const conversation = boolean('show conversation', false) ? undefined : 'none'; + return ( + + ); +}; + +export const Moments = () => { + const limit = number('limit to', 2); + return ( + + ); +}; + +export const Timelines = () => { + const tweetLimit = number('limit to', 5); + const timelineSourceType = select( + 'source type', + ['profile', 'likes', 'list', 'source', 'collection', 'url', 'widget'], + 'profile' + ); + const timelineScreenName = 'amphtml'; + const timelineUserId = '3450662892'; + return ( + + ); +}; + +export const DeletedTweet = () => { + const withFallback = boolean('include fallback?', true); return ( - +

In case you missed it last week, check out our recap of AMP in 2020 @@ -48,6 +106,31 @@ export const Default = () => { https://t.co/eaxT3MuSAK

+ {withFallback && ( +
+ An error occurred while retrieving the tweet. It might have been + deleted. +
+ )} +
+ ); +}; + +export const InvalidTweet = () => { + return ( + + ); };