-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathWatchPage.js
24 lines (21 loc) · 859 Bytes
/
WatchPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { useEffect } from "react"
import { useDispatch } from "react-redux"
import { closeSideBar } from "../utils/appSlice"
import { useSearchParams } from "react-router-dom"
import CommentContainer from "./CommentContainer"
const WatchPage = () => {
const [searchParam] = useSearchParams()
const videoId = searchParam.get("v")
const dispatch = useDispatch()
useEffect(() => {
dispatch(closeSideBar())
}, [])
return (
<div className="col-span-4 p-2">
<iframe className="w-[100%]" height="450" src={"https://www.youtube.com/embed/" + videoId} title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen></iframe>
<CommentContainer />
<div className="w-[100%]"></div>
</div>
)
}
export default WatchPage