Skip to content

Commit

Permalink
Merge pull request #272 from htor/fix-vids
Browse files Browse the repository at this point in the history
Fix broken video aspect ratios
  • Loading branch information
cleary authored May 2, 2024
2 parents e4b9116 + 30ee2c9 commit 4249e4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/youtube/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { video } from "./styles.module.css";
import styles from "./styles.module.css";

/**
* Component for embedding YouTube videos
Expand All @@ -12,7 +12,7 @@ import { video } from "./styles.module.css";
*/
export function YouTube({ id, aspect = 16 / 9 }) {
return (
<figure className={video} style={{ paddingBottom: `${100/aspect}%` }}>
<figure className={styles.video} style={{ paddingBottom: `${100/aspect}%` }}>
<iframe
src={`https://www.youtube.com/embed/${id}`}
frameBorder="0"
Expand All @@ -21,4 +21,4 @@ export function YouTube({ id, aspect = 16 / 9 }) {
/>
</figure>
);
}
}

0 comments on commit 4249e4a

Please sign in to comment.