diff --git a/README.md b/README.md
index c6afd829a..3d2b4eef2 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Netflix clone
+# Youtube clone
To run the project
### 1. Clone this project
-`git clone https://github.com/ib-sundeep/netflix-react-clone.git`
+`git clone https://github.com/siddharthInterviewbit/youtube-react-clone.git`
### 2. Install dependencies of project
diff --git a/src/pages/HomePage.js b/src/pages/HomePage.js
index 2e9f5100c..b2290e8c8 100644
--- a/src/pages/HomePage.js
+++ b/src/pages/HomePage.js
@@ -1,30 +1,15 @@
-import React from 'react';
-
-import MediaSlider from "ui/MediaSlider";
-import Header from "ui/Header";
-import Sidebar from "ui/Sidebar";
-import { useState } from "react";
-
-
+import React, { useState } from 'react';
+import Header from 'ui/Header';
+import Sidebar from 'ui/Sidebar';
function HomeScreen() {
const [isToggledSidebar, setIsToggledSideBar] = useState(true);
-
return (
- setIsToggledSideBar((isToggled) => !isToggled)}
- />
+ setIsToggledSideBar((isToggled) => !isToggled)}/>
-
);
}
diff --git a/src/styles/_header.scss b/src/styles/_header.scss
index 1889a88b5..f506022d3 100644
--- a/src/styles/_header.scss
+++ b/src/styles/_header.scss
@@ -95,5 +95,4 @@
.hp-header-right > .r-icon{
margin: auto 0.7rem;
}
-}
-
+}
\ No newline at end of file
diff --git a/src/ui/Header.js b/src/ui/Header.js
index aa2095cbc..472686e3c 100644
--- a/src/ui/Header.js
+++ b/src/ui/Header.js
@@ -1,7 +1,7 @@
-//hooks
-import {useState} from 'react';
-//Material UI icons
+import { useState } from "react";
+
import MenuIcon from "@mui/icons-material/Menu";
+import yt_logo from "../assets/youtube-logo.svg"
import ClearIcon from "@mui/icons-material/Clear";
import SearchIcon from "@mui/icons-material/Search";
import KeyboardVoiceIcon from "@mui/icons-material/KeyboardVoice";
@@ -10,69 +10,46 @@ import AppsIcon from "@mui/icons-material/Apps";
import NotificationsIcon from "@mui/icons-material/Notifications";
import { Avatar } from "@mui/material";
-//Images
-import yt_logo from "../assets/youtube-logo.svg";
-
const Header = (props) => {
- //style
const iconColor = {
color: "white",
cursor: "pointer"
- };
- const [searchTerm, setSearchTerm] = useState('');
- const searchInputHandler=(e)=>{
- setSearchTerm(e.target.value);
}
- return (
-
+ const [searchTerm, setSearchTerm] = useState('hello world');
+ const searchInputHandler=(e) => {
+ setSearchTerm(e.target.value);
+ }
+ return(
+
-
{
props.onClickMenu();
}}
/>
-
+
-
+
- );
-};
-export default Header;
+ )
+}
+export default Header;
\ No newline at end of file
diff --git a/src/ui/MediaCard.js b/src/ui/MediaCard.js
index 0b018c2c4..e69de29bb 100644
--- a/src/ui/MediaCard.js
+++ b/src/ui/MediaCard.js
@@ -1,80 +0,0 @@
-import React, { useState } from 'react';
-import classNames from 'classnames';
-
-import { generateImageUrl, ImageSizes } from "utils/tmdb";
-import TrailerModal from './TrailerModal';
-import AccountCircleIcon from '@mui/icons-material/AccountCircle';
-
-function dayDiff(d) {
- const date1 = new Date();
- const date2 = new Date(d);
- const diffTime = Math.abs(date2 - date1);
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
- const months = date1.getMonth() - date2.getMonth() +
- (12 * (date1.getFullYear() - date2.getFullYear()))
- const year = Math.ceil(months/12);
- console.log(months);
- if(diffDays < 31) {
- return (diffDays + " days");
- } else if(months < 12) {
- return months + " months"
- } else {
- return year+" years"
- }
-}
-function MediaCard({ media, mediaType, isLarge }) {
- const [isTrailerOpen, setTrailerOpen] = useState(false);
- const iconColor = {
- color: "white",
- cursor: "pointer",
- height: 45,
- width: 45,
- };
- return (
- <>
-
setTrailerOpen(true)}
- >
-

-
-
-
-
- {media.title || media.name || media.original_name}
-
-
- {dayDiff(media.first_air_date) + ' ago'}
-
-
-
-
- {isTrailerOpen && (
-
setTrailerOpen(false)}
- />
- )}
- >
- );
-}
-
-export default MediaCard;
diff --git a/src/ui/MediaSlider.js b/src/ui/MediaSlider.js
index 2a6a8ff6b..e69de29bb 100644
--- a/src/ui/MediaSlider.js
+++ b/src/ui/MediaSlider.js
@@ -1,35 +0,0 @@
-import React, { useState, useEffect } from "react";
-
-import MediaCard from "./MediaCard";
-import tmdbApi from 'api/tmdb';
-
-function MediaSlider({ mediaType, title, path, params = {}, isLarge }) {
- const [items, setItems] = useState([]);
-
- useEffect(() => {
- const fetchData = async () => {
- const json = await tmdbApi.get(path, params);
- setItems(json.results);
- };
- fetchData();
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
-
-
- return (
-
-
- {items.map((media) => (
-
- ))}
-
-
- );
-}
-
-export default MediaSlider;
diff --git a/src/ui/Sidebar.js b/src/ui/Sidebar.js
index 06e9de63a..d87ed7987 100644
--- a/src/ui/Sidebar.js
+++ b/src/ui/Sidebar.js
@@ -1,7 +1,10 @@
import PrimarySidebar from "./PrimarySidebar";
-import SecondarySideBar from "./SecondarySidebar";
+import SecondarySidebar from "./SecondarySidebar";
-const Sidebar = ({ toggleSidebar }) => {
- return toggleSidebar ? : ;
+const Sidebar = ({toggleSidebar}) => {
+ console.log(toggleSidebar);
+ return (
+ toggleSidebar ? :
+ );
};
-export default Sidebar;
+export default Sidebar;
\ No newline at end of file
diff --git a/src/ui/TrailerModal.js b/src/ui/TrailerModal.js
index 127704272..e69de29bb 100644
--- a/src/ui/TrailerModal.js
+++ b/src/ui/TrailerModal.js
@@ -1,44 +0,0 @@
-import tmdbApi from 'api/tmdb';
-import React, { useEffect, useState } from 'react';
-
-function TrailerModal({ mediaType, mediaId, onClose }) {
- const [videoId, setVideoId] = useState(null);
-
- useEffect(() => {
- async function fetchTrailer() {
- const json = await tmdbApi.get(`/${mediaType}/${mediaId}/videos`);
- const video = json.results.find(o => o.site === 'YouTube');
- setVideoId(video?.key);
- }
-
- fetchTrailer();
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
-
- return (
- <>
-
-
- {videoId && (
-
- )}
-
-
- >
- );
-}
-
-export default TrailerModal;