Skip to content

Commit 967984a

Browse files
committed
feat: 🎸 stretch YouTube videos 100%
BREAKING CHANGE: 🧨 YouTube embeds are now stretched to 100% width. Limit stretching by wrapping this component in a custom <div>.
1 parent b3cbd8c commit 967984a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/blocks/youtube/index.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ import {BlockProps} from '../..';
44
import {rule} from 'p4-css';
55

66
const blockClass = rule({
7+
w: '100%',
8+
});
9+
10+
const iframeClass = rule({
711
d: 'block',
812
maxW: '100%',
13+
w: '100%',
914
});
1015

1116
const Y = YouTube as any;
1217

13-
const YouTubeWrapper: React.SFC<BlockProps> = ({id, renderWrap}) => {
14-
return renderWrap(<Y videoId={id} className={blockClass} />);
18+
const YouTubeWrapper: React.FC<BlockProps> = ({id, renderWrap}) => {
19+
return renderWrap(<Y videoId={id} containerClassName={blockClass} className={iframeClass} />);
1520
};
1621

1722
export default YouTubeWrapper;

0 commit comments

Comments
 (0)