diff --git a/extensions/amp-twitter/1.0/base-element.js b/extensions/amp-twitter/1.0/base-element.js index 970dc72e4c19..d9a7703b8892 100644 --- a/extensions/amp-twitter/1.0/base-element.js +++ b/extensions/amp-twitter/1.0/base-element.js @@ -1,10 +1,10 @@ import {PreactBaseElement} from '#preact/base-element'; -import {Twitter} from './component'; +import {BentoTwitter} from './component'; export class BaseElement extends PreactBaseElement {} /** @override */ -BaseElement['Component'] = Twitter; +BaseElement['Component'] = BentoTwitter; /** @override */ BaseElement['props'] = { diff --git a/extensions/amp-twitter/1.0/component.js b/extensions/amp-twitter/1.0/component.js index 5e5459e5a2f8..76496e0eaa57 100644 --- a/extensions/amp-twitter/1.0/component.js +++ b/extensions/amp-twitter/1.0/component.js @@ -11,11 +11,11 @@ const FULL_HEIGHT = '100%'; const MATCHES_MESSAGING_ORIGIN = () => true; /** - * @param {!TwitterDef.Props} props - * @param {{current: (!TwitterDef.Api|null)}} ref + * @param {!BentoTwitterDef.Props} props + * @param {{current: (!BentoTwitterDef.Api|null)}} ref * @return {PreactDef.Renderable} */ -function TwitterWithRef( +function BentoTwitterWithRef( { cards, conversation, @@ -102,6 +102,6 @@ function TwitterWithRef( ); } -const Twitter = forwardRef(TwitterWithRef); -Twitter.displayName = 'Twitter'; // Make findable for tests. -export {Twitter}; +const BentoTwitter = forwardRef(BentoTwitterWithRef); +BentoTwitter.displayName = 'BentoTwitter'; // Make findable for tests. +export {BentoTwitter}; diff --git a/extensions/amp-twitter/1.0/component.type.js b/extensions/amp-twitter/1.0/component.type.js index 688b4494f368..917e8f48ce87 100644 --- a/extensions/amp-twitter/1.0/component.type.js +++ b/extensions/amp-twitter/1.0/component.type.js @@ -1,7 +1,7 @@ /** @externs */ /** @const */ -var TwitterDef = {}; +var BentoTwitterDef = {}; /** * @typedef {{ @@ -12,10 +12,10 @@ var TwitterDef = {}; * onLoad: (function():undefined|undefined), * }} */ -TwitterDef.Props; +BentoTwitterDef.Props; /** @constructor */ -TwitterDef.Api = function () {}; +BentoTwitterDef.Api = function () {}; /** @type {string} */ -TwitterDef.Api.prototype.readyState; +BentoTwitterDef.Api.prototype.readyState; diff --git a/extensions/amp-twitter/1.0/storybook/Basic.js b/extensions/amp-twitter/1.0/storybook/Basic.js index d490a15c25e4..64a67c3c9f31 100644 --- a/extensions/amp-twitter/1.0/storybook/Basic.js +++ b/extensions/amp-twitter/1.0/storybook/Basic.js @@ -1,10 +1,10 @@ import * as Preact from '#preact'; -import {Twitter} from '../component'; +import {BentoTwitter} from '../component'; import {boolean, number, select, withKnobs} from '@storybook/addon-knobs'; export default { title: 'Twitter', - component: Twitter, + component: BentoTwitter, decorators: [withKnobs], }; @@ -17,7 +17,7 @@ export const _default = () => { 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 ( - { const timelineScreenName = 'amphtml'; const timelineUserId = '3450662892'; return ( - { it('should render', () => { const wrapper = mount( - { it('should call given requestResize', () => { const requestResizeSpy = env.sandbox.spy(); const wrapper = mount( - { it('should change height', async () => { const wrapper = mount( - { const ref = createRef(); const onReadyState = env.sandbox.spy(); const wrapper = mount( - { const ref = createRef(); const wrapper = mount( - { const onErrorSpy = env.sandbox.spy(); const wrapper = mount( - + > ); const iframe = wrapper.find('iframe').getDOMNode(); @@ -169,13 +169,13 @@ describes.sandboxed('Twitter preact component v1.0', {}, (env) => { const onLoadSpy = env.sandbox.spy(); const wrapper = mount( - + > ); const iframe = wrapper.find('iframe').getDOMNode();