Skip to content

Commit

Permalink
Refactor YouTube component to use ChakraUI
Browse files Browse the repository at this point in the history
  • Loading branch information
minimalsm committed Sep 6, 2022
1 parent 5cbb890 commit f0ec932
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/components/YouTube.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React from "react"
import styled from "@emotion/styled"

const Figure = styled.figure`
display: block;
margin: 1rem 0;
`
import { Box } from "@chakra-ui/react"

/**
* @param {id} ID of the YouTube video
Expand All @@ -27,7 +22,7 @@ const YouTube: React.FC<IProps> = ({ id, start = "0", title = "YouTube" }) => {
const baseUrl = "https://www.youtube.com/embed/"
const src = baseUrl + id + startQuery
return (
<Figure>
<Box as="figure" display="block" marginY="1rem">
<iframe
width="100%"
height="315"
Expand All @@ -43,7 +38,7 @@ const YouTube: React.FC<IProps> = ({ id, start = "0", title = "YouTube" }) => {
picture-in-picture"
allowFullScreen
></iframe>
</Figure>
</Box>
)
}

Expand Down

0 comments on commit f0ec932

Please sign in to comment.