Skip to content

Commit

Permalink
Add Storybook example for amp-twitter:0.1 (#33300)
Browse files Browse the repository at this point in the history
* Add 0.1 amp-twitter Storybook sample

* Update Storybook-addon version
  • Loading branch information
caroqliu committed Mar 22, 2021
1 parent c7dbb3d commit 446c51d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions extensions/amp-twitter/0.1/storybook/Basic.amp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Copyright 2021 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as Preact from '../../../../src/preact';
import {text, withKnobs} from '@storybook/addon-knobs';
import {withA11y} from '@storybook/addon-a11y';
import {withAmp} from '@ampproject/storybook-addon';

export default {
title: 'amp-twitter-0_1',
decorators: [withKnobs, withA11y, withAmp],

parameters: {
extensions: [
{
name: 'amp-twitter',
version: '0.1',
},
],
},
};

export const Default = () => {
const tweetId = text('tweet id', '1356304203044499462');
return (
<amp-twitter width="300" height="200" data-tweetid={tweetId}>
<blockquote placeholder>
<p lang="en" dir="ltr">
In case you missed it last week, check out our recap of AMP in 2020
⚡🙌
</p>
<p>
Watch here ➡️
<br />
<a href="https://t.co/eaxT3MuSAK">https://t.co/eaxT3MuSAK</a>
</p>
</blockquote>
</amp-twitter>
);
};

0 comments on commit 446c51d

Please sign in to comment.