Andialsohave a medicinekindofnightmodehereifyouwanttoshiftthecolorfor a lightbeamto a darkthemeandwe'regoingtousestylecomponentsforalltheCSSstylinghere, and I'm goingtoshowyouhowwecanusedifferentthemingandstufflikethat.
So I'm reallyexcitedforyoutoseethisbecause I lovethisnewhooksand I alsothinkstylecomponentsisgreat.
Ifwegotothereactsite, wecanread a littlebitofhookshereatthetimeoftherecordingoffthiscourse, they'refairlynew, sothey'renotanofficialreleaseyet, SoyouhavetousethisAlfabuild, overreacttohaveaccesstothehooks.
Butthat's okay.
We'llgothroughthatin a bit.
We'regoingtoinstallit, sodon't worryaboutit.
Sowe'regoingtousethestatehookandtheeffecttook.
There's a lotmorehooksandyoucanreadaboutthemhereatthesite.
Youcanalsocreateyourownhooks.
I thinkthefaketookandthestatehookaretheonesyou'regoingtousein 95% ofthecaseswhenyoucode, sotheythemostimportantandtheywillkindofreplacethestateintheclasscomponentandthelifecyclemethods.
Itwillgiveussomenicefunctionality, likecoolbackswhenthey'replayingthevideoandcallbackswhenthevideohasplayedandthingslikethat, wecoulddoeverythingourselvesinon I frame.
Butthere's a lotmorecoding, soit's bettertousethislibraryandhaveallthisforfree.
Sowhycreatedfromscratchwhenhedon't needto?
We'realsogoingtouseas a setofstylecomponentsonthestyle.
I'llshowyouthatin a latervideo, andwe'realsogoingtousetheReactrouterforroutingorvideosbecauseifyoulookuphere, youcanseewehave a unique I D foreachvideo.
Soifweclickanotherone, wehave a notalreadyandweuseroutingforthat.
Beforeyoustartdoinganythingandmakesureyou'reinthatfullerandthenwejustdotheminstoreasthisisanintermediatecourse, I assumeyouknowhowtousetheterminalandMPMandallthisstuff.
Soifyoudon't, youprobablyshouldtake a storycoursebeforetakingthiscourse.
I actuallyhave a start, Ofcourse, wherewecreate a moveapplicationsoyoucanrollit.
Andthisoneisthemaincomponentforupwheremostofourlogicalgirland I alsosuppliedthestylesforyouherebecause I thinkthisis a reactcourseandnottoseeitsayscourse.
Hey, it's kindofboringseeingmecreating.
I'm writingCSS.
Ah, longtimehere.
Sowe'regoingtocreatemaybeoneortwoofthesewhenwegothroughthestylecomponentsandtheotherwalls, I giveyouforfree, soyoudon't havetodothatbyyourself.
Allright, we'regoingtostartscaffoldingout, orcomponentsandthestructureofthisapplicationsoWe'regoingtocreate a lotoffunctionalcomponentshere, andwejustcreatesomebasicstuffintherenow, Sowe'regoingtocomebacktoallofthemandfinishthemlateronsowecanstartwiththe W B N playerdoctors.
Andinthisworld, we'realsogoingtoneed a videoand a playlistbecausethevideoisthekindofwindoweverplaythevideoandtheplaylististoplaylisttotherightintheapplication.
Itwilllookatithere, where I haveit.
No, I have a deer.
Yeah, Sothisistheplaylist.
Andherewe'regoingtohave a nightmorecomponent.
We'regoingtohave a head a component, andthisoneisalsocontainerIt's theplaylistitemscontainer, andthisiseach a playlistcomponentofftheseoneshere, andthisisthevideocomponentweareusinghere.
Sobearwithmewillfixthisin a second, andweimport a playlistfromthisoneisgoingtobeDrForrestlastcontainersonplaylistbecausethisoneis a containerandtheotheronesarejustpresentationalcomponentsandtheygooutsidethecontainersfolder.
Thenwecreatetheconst.
W B onplayerpropsare a functionlikethisandalsomakesureyouhavethecasingrightoneverythingwedointhiscourse.
Because I knowthere's a lotofpeoplehavingtroublesometimes, andit's in 90% ofthecase.
It's, ah, sometypeerrororit's thecasingherethat's different, anditwillthrowinerrorifyoudon't havethecasingexactlylike I writeithereinthevideo.
Butwearegoingtoneedtheplaylistheaderimportthatonefromdotthoughtforwardslashplaylistheaderlikesowe'realsogoingtoneed a playlistitemsandwegrabthatfromDrForwardslashcontainerslayleastitemsandwe'regoingtoneedournightmode.
So I suggestyoudothatalso, ifyou'reinterestedinlearningmoreaboutyoursixandJavaScriptandasyouseethewriterstyleinsideofthesebackticksanditwillcreate a componentforustouseinourcode.
I choosetodoitthiswaybecause I likeit, and I thinkit's fittingforthisapplicationandthiscourse, allright, you'regoingtoworkintheactofJsfilethistimealso, andWe'realsogoingtoworkwith a globalstyledoctor.
I justwantedtoprovideyouwiththeseifyoudon't wanttodoallthissowegobacktoheractofgas, wehavetoimportourglobalstylethatwejustcreatedGlobalStarfromWegrabthatfromDrForwardSlashtilesGlobalstyle.
I thinkit's goodtorepeatthingsbecausethatwhereyoulearn a lotfasterandmaybeit's boringandyoualreadyhavethiscodeas a Stoller, youcanjustsaveitandletitbe.
But I highlyrecommendthatyoudolikethisandrepeatitandjustwriteitbecauseyourbrainwilllearn a lotmoreifyouwriteitdownyourself.
We'regoingtotalk a littleaboutthemingandhowwecanuseittohavedifferentthemesin a rap.
Solet's getstartedhere.
We'regoingtobemostlyin R W B M playerDocJsfile, somakesureyounavigateintothatcomponentstylecomponentshavesomethingcalled a themeprovider, andwecanusethattoswitchdifferentthemesinourapplication, andalsowecanuseittosortofsetupdifferentpropertiesthatwe'regoingtoreusesomewhereinourstyles.
No, causewehavenostateyetandwehaven't fixedallotherthings.
Soitwillthrownarrownowandwe'regoingtoreplacehisfragmentherewithor w B onplayerStilesfirst, ofcourse, weretooimportant, sowegrabbedhimfromimportsstyle W B M playerfromdot, dotforwardslashstylesstyled W B andplayerlikesoandnowwecanuseit.
Wealsohavecreated a stylefortheplayercomponenthere.
Soifwegointoourstylesfolderandstyle w, B andplayerandthisissowecanaccessthevaluesinthetwothemeswecreatedinthecomponentsowecangetagain, deleteallofthisandwe'regoingtocreateitfromscratchonweimportstylefromstylecomponentsjustice.
Beforeonwecreatethecostofstyle w B n playerandwereyoustyledthatweimported?
Andit's a dealthistimealsocreatetobackticksandwewriteourCSSinsideofthesebackticksdestinedbefore, Soourbackgroundaregoingtobebasedonifwehavethelightordarkthing, andhowdoweaccessthiswellinor w B onplayerthat, yes, weusedthesethemeproviderandsupplythetheme.
Thatmeanswenowhave a propthat's namedTheme, andwecanaccessallofthesevaluesinthisprop.
Sowegobacktoourstylestyle w B andplayerdoctor.
Yes, andfor a backgroundwegraborProck, wedothatbydollarsignandcurlybrackets.
Wehave a nicemode, andthat's itforthiscomponenton.
We'regoingtocreatethisone's in a latervideo.
Sodon't worry.
Savethisone, okay?
Wehave a fewmorecomponentsleftthatwe'regoingtoimportorstylesfor, Sowe'regoingtoherplaceheadedup J s andweimportorstyledplaylistheatherfromdotforwardslashstilesStilesplaylistheaderlikesoandthenweimportorstyledjourneyfromdon't forcelaststylesstalledduringitandthisisalsoquite a smallcomponents.
I thinkwecanfinishthisoffrightnow.
WehaveourstyleplaylistheaderWrapitinthatone.
Thenwehave a p tagongrabthatfrom a probecalledactivedottitle.
Thenwehaveourstylejourneyandalsofromtheactivepropwegrabbed a numbon.
WeimportstiledvideorapperfromnotforwardslashStylesstylevideorapperandweimportstylevideofromdotforwardslashstylesStyledvideolikeso I actuallythinkwe'regoingtofinishthisoneoffalso.
Andwe'regoingtotalkmoreaboutthesecomponentslateronwhenweareassemblingthevideoplayerwiththesecomponentssoeverproperactive, wehaveanorderplay, wehaven't endcallback, andwehave a progresscallback.
Wechangedthisonetostartvideo.
Andinsideofthisone, wehave a stylevideorapper, likesoandorwreckedplayergoesinsidetheseonesDirectplayerortheonethatweimportedhereandalsoinstalledwithanPMearlier.
As I said, we'regoingtotalkmoreaboutthislateron, but I thoughtwecouldfinishthemaswellalreadyherenow, Firstofall, we'regoingtocorrectsomelittletypeerrorideainthelastvideo.
Thelastthingwehavetodohereistokindofassembleeverythinginthe w B onplayerdotYes, andwe'realsogoingtocreateemptycallbackfunctionsjustsowedon't getanarrowbecausetheydon't existandthenwe'regoingtofillthemoutandcreatethemin a latervideo.
Ifwegointoourcomponent, wecancreate a contestnomode.