r/reactjs • • May 14 '21

Show /r/reactjs Made a YouTube Clone with React and Material UI

555 Upvotes

29 comments sorted by

13

u/theshubhagrwl May 14 '21

I followed a tutorial on YouTube and have added some features to it

  • Improved UI

  • Made it responsive

  • Added Theme Toggler

  • Used MUI's CSS in JS

GitHub: https://github.com/theshubhagrwl/youtube-clone-react

Project Link:https://youtube-clone-the.netlify.app/

5

u/Silencer306 May 14 '21

Can you also link that tutorial?

4

u/theshubhagrwl May 14 '21

2

u/Callmebobbyorbooby May 15 '21

Sonny is the man. He’s branched off to do his own thing and has some great new tutorials. Way less distractions when it’s just him. His tutorials are my favorite.

1

u/theshubhagrwl May 15 '21

His explanations are simple and awesome.

1

u/PhantomusPrime May 18 '21

Hey, can you please tell me the name of his new channel or is it more like a paid course?

35

u/ZeeGermans27 May 14 '21 edited May 14 '21

Looks nice, however it appears to not be fully functional yet - search mechanism isn't working properly, any phrase returns the same results + it lacks QoL feature which is submiting search query with enter key.

Apart from that minor inconvenience I would recommend some changes in the project's structure, for example:

  • merge Sidebar and SidebarRow components into one - there's no point in splitting code between two of them

  • use CSS grid system in VideoRow and SearchPage instead of display: flex; because it might go bonkers with bigger amount of results (especially in terms of div overlapping and text "escaping" its parent container) and grids are much, MUCH more flexible and customizable; same goes for RecommendedVideos component

  • I would also put ChannelRow logic into VideoRow and make it conditionally render content based on the type of element instead of using two separate components, checking whether the element is a Channel or a Video

  • general naming convention - VideoRow to VideoGrid, VideoCard to Video, Header to Navbar and so on, you get the idea

  • the most important thing - how you handle search results. you should get all of them into a dedicated VideoGrid component instead of separate SearchPage and manage them via state. best solution would be to merge SearchPage and VideoRow logic into new component called VideoGrid

5

u/theshubhagrwl May 14 '21

Yes search shows a static result. For search to work I had to pull data from YouTube API. I mainly focused on the UI part here.

Thanks for pointing out search with enter key. Will fix it!

1

u/ZeeGermans27 May 14 '21

I made a small update into my previous comment, check it out

1

u/theshubhagrwl May 14 '21

Thanks for the suggestions, will try to improve as much as I can

17

u/noisette666 May 14 '21 edited May 15 '21

G-t-c: repeat(auto-fit, minmax(300px, 1fr));

My mind was blown when I learned about auto-fit and auto-fill

Saved me writing loads of crappy code

Edited: added minmax

4

u/ZeeGermans27 May 14 '21

IMO it's a god-tier feature of CSS.

0

u/[deleted] May 15 '21

[deleted]

0

u/ZeeGermans27 May 15 '21

For fuck sake mate, it was only a suggestion xD

85

u/francamara May 14 '21

Wait, google app with react code ? Thats illegal

3

u/Egarok May 15 '21

This is just a UI built with MaterialUI -no search functionality, no complex React concepts, not even an API call with useEffect -I expect nothing more from a video by Clever Programmer

1

u/theshubhagrwl May 15 '21

I am thinking of adding YouTube API.

4

u/Daggy1234 May 15 '21

Agreed doesn't even have oauth , or working menus. Forget video hosting and streaming. Idk why react when this could be done with vanilla js and css

2

u/ZeeGermans27 May 17 '21

exactly - at this point I'd expect to be able to call President of the Universe on voice chat and not to just be served with some static search results.

16

u/[deleted] May 14 '21

Self-tube? Self host videos. Decentralize YouTube!

2

u/SwedishRagnar May 14 '21

Hahaha lets gooo

3

u/[deleted] May 14 '21

The maker should attempt to integrate with BAT (Basic Attention Token) crypto to assist people to monetize.

3

u/[deleted] May 14 '21

Another feature is integration with CDNs—content delivery networks or write your own CDN. Make a go fund me or kick starter.

1

u/meera_datey May 16 '21

Great job! Looks awesome!

BTW, I always find material ui bit flakey. You never know when the screen will turn all white or keys will not be sync with input.

Did you like material ui?

2

u/theshubhagrwl May 17 '21

I like MUI, I have used it in my other projects also.

At first it was a little difficult to customize but now I understand it.

I haven't faced issues which you are referring to.

Overall I think it works well.

3

u/kijour May 14 '21

Looks great, best way to learn is to work through a project like this.

0

u/[deleted] May 14 '21

[deleted]

1

u/theshubhagrwl May 15 '21

Just wanted some good stuff there.

My videos have poor audio quality(just a beginner in making videos), have to compensate for that. LOL