r/reactjs • u/theshubhagrwl • May 14 '21
Show /r/reactjs Made a YouTube Clone with React and Material UI
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
SidebarandSidebarRowcomponents into one - there's no point in splitting code between two of themuse CSS grid system in
VideoRowandSearchPageinstead ofdisplay: 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 forRecommendedVideoscomponentI would also put
ChannelRowlogic intoVideoRowand 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 Videogeneral naming convention -
VideoRowtoVideoGrid,VideoCardtoVideo,HeadertoNavbarand so on, you get the ideathe most important thing - how you handle search results. you should get all of them into a dedicated
VideoGridcomponent instead of separateSearchPageand manage them via state. best solution would be to mergeSearchPageandVideoRowlogic into new component calledVideoGrid
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
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
0
85
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
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
May 14 '21
Self-tube? Self host videos. Decentralize YouTube!
2
u/SwedishRagnar May 14 '21
Hahaha lets gooo
3
May 14 '21
The maker should attempt to integrate with BAT (Basic Attention Token) crypto to assist people to monetize.
3
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
0
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
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/