Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion youtube/src/components/Comments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import { useEffect } from 'react'

const Comments = () => {

Expand Down
13 changes: 0 additions & 13 deletions youtube/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ const Header = () => {
},[searchQuery]);


/*
* key - i
* render the component
* useEffect();
* start timer → make api call after 200 ms

* key - ip
* destroy the component(useffect return method)
* re-render the component
* useEffect()
* start timer = make api call after 200 ms
*/

return (
<div className="grid grid-flow-col p-2 m-2 shadow-lg">
<div className="flex col-span-1">
Expand Down
1 change: 1 addition & 0 deletions youtube/src/components/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from "react-router-dom";

const SideBar = () => {
const sidebarVisible = useSelector(state => state.app.isMenuOpen);

return (
sidebarVisible ?
(<div className="p-5 shadow-lg w-56 col-span-2">
Expand Down
3 changes: 2 additions & 1 deletion youtube/src/components/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ const Subscriptions = () => {
useEffect(() => {
getSubscription();
},[])

return (
<div>
Channnel Page Here
</div>
)
);
}

export default Subscriptions
3 changes: 2 additions & 1 deletion youtube/src/components/VideoListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import VideoCard from "./VideoCard";
const VideoListContainer = () => {
const dispatch = useDispatch();
const videData = useSelector(state => state.app.videoData);

const getVideos = async () => {
console.log(YOUTUBE_VIDEO_API);
const data = await fetch(YOUTUBE_VIDEO_API);
Expand All @@ -22,7 +23,7 @@ const VideoListContainer = () => {
<div>
<VideoCard videData={videData}/>
</div>
)
);
}

export default VideoListContainer
20 changes: 9 additions & 11 deletions youtube/src/components/WatchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ const WatchPage = () => {
}, []);

return (
<div className="flex flex-col">
<div>
<iframe width="1400" height="600"
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" referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
<CommentContainer />
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unecessary removal here.

<div>
<iframe width="1400" height="600"
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"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
)
}
Expand Down