Skip to content

Commit

Permalink
feat: 🎸 stretch YouTube videos 100%
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 YouTube embeds are now stretched to 100% width. Limit stretching by
wrapping this component in a custom <div>.
  • Loading branch information
streamich committed Feb 16, 2020
1 parent b3cbd8c commit 967984a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/blocks/youtube/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import {BlockProps} from '../..';
import {rule} from 'p4-css';

const blockClass = rule({
w: '100%',
});

const iframeClass = rule({
d: 'block',
maxW: '100%',
w: '100%',
});

const Y = YouTube as any;

const YouTubeWrapper: React.SFC<BlockProps> = ({id, renderWrap}) => {
return renderWrap(<Y videoId={id} className={blockClass} />);
const YouTubeWrapper: React.FC<BlockProps> = ({id, renderWrap}) => {
return renderWrap(<Y videoId={id} containerClassName={blockClass} className={iframeClass} />);
};

export default YouTubeWrapper;

0 comments on commit 967984a

Please sign in to comment.