Skip to content

Commit

Permalink
📚 docs: add Youtube embed component (#47467)
Browse files Browse the repository at this point in the history
  • Loading branch information
letiescanciano authored Nov 4, 2024
1 parent e1bf707 commit b47a9ec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-lite-youtube-embed": "^2.4.0",
"react-markdown": "^8.0.7",
"react-router": "5.3.3",
"sanitize-html": "^2.12.1",
Expand Down
14 changes: 14 additions & 0 deletions docusaurus/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docusaurus/src/components/YoutubeEmbed.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import LiteYouTubeEmbed from "react-lite-youtube-embed";
import "react-lite-youtube-embed/dist/LiteYouTubeEmbed.css";

export const YoutubeEmbed = ({ id, title }) => {
return (
<LiteYouTubeEmbed
id={id}
title={title}
poster="maxresdefault"
/>
);
};
3 changes: 3 additions & 0 deletions docusaurus/src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { CardWithIcon } from "../../components/Card/Card";
import { Details } from "../../components/Details";
import { EntityRelationshipDiagram } from "../../components/EntityRelationshipDiagram";
import { Grid } from "../../components/Grid/Grid";
import { YoutubeEmbed } from "../../components/YoutubeEmbed";

export default {
// Re-use the default mapping
...MDXComponents,
Expand All @@ -27,4 +29,5 @@ export default {
EntityRelationshipDiagram,
CardWithIcon,
Grid,
YoutubeEmbed,
};

0 comments on commit b47a9ec

Please sign in to comment.