Skip to content

Commit

Permalink
♻️ Rename Youtube to BentoYoutube (#35996)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorozco committed Sep 8, 2021
1 parent 2c31455 commit 212fcb6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-youtube/1.0/base-element.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {Youtube} from './component';
import {BentoYoutube} from './component';

import {VideoBaseElement} from '../../amp-video/1.0/video-base-element';

export class BaseElement extends VideoBaseElement {}

/** @override */
BaseElement['Component'] = Youtube;
BaseElement['Component'] = BentoYoutube;

/** @override */
BaseElement['props'] = {
Expand Down
8 changes: 4 additions & 4 deletions extensions/amp-youtube/1.0/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function createDefaultInfo() {
* @return {PreactDef.Renderable}
* @template T
*/
function YoutubeWithRef(
function BentoYoutubeWithRef(
{
autoplay,
loop,
Expand Down Expand Up @@ -247,6 +247,6 @@ function makeMethodMessage(method) {
);
}

const Youtube = forwardRef(YoutubeWithRef);
Youtube.displayName = 'Youtube'; // Make findable for tests.
export {Youtube};
const BentoYoutube = forwardRef(BentoYoutubeWithRef);
BentoYoutube.displayName = 'BentoYoutube'; // Make findable for tests.
export {BentoYoutube};
14 changes: 7 additions & 7 deletions extensions/amp-youtube/1.0/storybook/Basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
BentoAccordionHeader,
BentoAccordionSection,
} from '../../../amp-accordion/1.0/component';
import {Youtube} from '../component';
import {BentoYoutube} from '../component';

export default {
title: 'YouTube',
component: Youtube,
component: BentoYoutube,
decorators: [withKnobs],
};

Expand All @@ -29,7 +29,7 @@ export const _default = () => {
const params = object('params', {});
const credentials = text('credentials', 'include');
return (
<Youtube
<BentoYoutube
autoplay={autoplay}
loop={loop}
videoid={videoid}
Expand Down Expand Up @@ -65,7 +65,7 @@ function WithStateTable({autoplay, credentials, loop, params, style, videoid}) {

return (
<>
<Youtube
<BentoYoutube
ref={ref}
autoplay={autoplay}
loop={loop}
Expand Down Expand Up @@ -114,7 +114,7 @@ export const liveChannelId = () => {
const params = object('params', {});
const credentials = text('credentials', 'include');
return (
<Youtube
<BentoYoutube
autoplay={autoplay}
loop={loop}
liveChannelid={liveChannelid}
Expand All @@ -137,7 +137,7 @@ export const InsideAccordion = () => {
<h2>Controls</h2>
</BentoAccordionHeader>
<BentoAccordionContent>
<Youtube
<BentoYoutube
loop={true}
videoid={videoid}
params={params}
Expand All @@ -150,7 +150,7 @@ export const InsideAccordion = () => {
<h2>Autoplay</h2>
</BentoAccordionHeader>
<BentoAccordionContent>
<Youtube
<BentoYoutube
autoplay={true}
loop={true}
videoid={videoid}
Expand Down
14 changes: 7 additions & 7 deletions extensions/amp-youtube/1.0/test/test-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {createRef} from '#preact';

import {useStyles} from 'extensions/amp-video/1.0/component.jss';

import {Youtube} from '../component';
import {BentoYoutube} from '../component';

describes.realWin('YouTube preact component v1.0', {}, (env) => {
let window, document;
Expand All @@ -23,7 +23,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {

it('Normal render', () => {
const wrapper = mount(
<Youtube
<BentoYoutube
videoid="IAvf-rkzNck"
style={{
'width': 600,
Expand All @@ -50,7 +50,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {

it('Pass correct param attributes to the iframe src', () => {
const wrapper = mount(
<Youtube
<BentoYoutube
videoid="IAvf-rkzNck"
autoplay
loop
Expand All @@ -77,7 +77,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {

it('Keep data param: loop in iframe src for playlists', () => {
const wrapper = mount(
<Youtube
<BentoYoutube
videoid="IAvf-rkzNck"
autoplay
loop
Expand All @@ -97,7 +97,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {

it('Uses privacy-enhanced mode', () => {
const wrapper = mount(
<Youtube
<BentoYoutube
videoid="IAvf-rkzNck"
autoplay
loop
Expand All @@ -119,7 +119,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {

it('should trigger onCanPlay when youtube iframe is loaded', () => {
const wrapper = mount(
<Youtube
<BentoYoutube
videoid="IAvf-rkzNck"
autoplay
loop
Expand Down Expand Up @@ -153,7 +153,7 @@ describes.realWin('YouTube preact component v1.0', {}, (env) => {
const ref = createRef();

const wrapper = mount(
<Youtube
<BentoYoutube
ref={ref}
videoid="IAvf-rkzNck"
shortcode="B8QaZW4AQY_"
Expand Down

0 comments on commit 212fcb6

Please sign in to comment.