All language subtitles for 14. Using Drawers

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,620 --> 00:00:08,330 Here we are at our project directory in the code editor and now that we have set up responsive design 2 00:00:08,330 --> 00:00:14,410 to get rid of our tabs and now we know about the draw component that we'll use to replace them. 3 00:00:14,450 --> 00:00:17,920 It's time to get started on implementing that. 4 00:00:18,060 --> 00:00:23,700 The first thing we're going to want to do actually is to come down to our terminal and here we're going 5 00:00:23,700 --> 00:00:31,900 to npm install material dash UI slash icons. 6 00:00:32,130 --> 00:00:34,880 And this is a package that they provide. 7 00:00:34,950 --> 00:00:41,910 There has an extensive suite of all sorts of different icons that you may need throughout any application 8 00:00:42,180 --> 00:00:49,750 that are completely available and free to use for go ahead and run that whenever it gets finished we'll 9 00:00:49,750 --> 00:00:50,580 be ready to go. 10 00:00:51,680 --> 00:00:52,070 All right. 11 00:00:52,080 --> 00:00:59,280 And you can see I have successfully installed the package at version four dot four dot three. 12 00:00:59,580 --> 00:01:06,210 With that ready we can go ahead and NPM start our server back up and that will get our application running 13 00:01:06,240 --> 00:01:08,640 so we can minimize that. 14 00:01:08,660 --> 00:01:16,080 And now let's start by going up to the top of our header dot J.S. file and let's import the swipe a 15 00:01:16,080 --> 00:01:26,530 ball draw from material dash a UI slash core slash swipe a ball draw. 16 00:01:26,670 --> 00:01:35,980 Next we're going to come down and import the menu icon from an app material. 17 00:01:36,250 --> 00:01:47,060 Dash UI slash icons slash menu now what's scroll on down here to the beginning of our function. 18 00:01:47,180 --> 00:01:54,110 And let's actually go to the material UI draw documentation page that we were just checking out in the 19 00:01:54,110 --> 00:02:01,550 last video and here where it talks about the swipe a bold draw and how you can optimize it for mobile 20 00:02:01,550 --> 00:02:02,410 performance. 21 00:02:02,420 --> 00:02:05,570 We're gonna go ahead and do that by copying here. 22 00:02:05,570 --> 00:02:11,960 This constant which checks to determine whether or not the user is on an IOW device. 23 00:02:11,960 --> 00:02:17,630 So we're going to copy that and we'll throw that up here underneath our theme and let's actually give 24 00:02:17,630 --> 00:02:18,550 us some space here. 25 00:02:18,560 --> 00:02:25,530 Now although actually let's put that underneath here so we have all of our hooks separated. 26 00:02:25,610 --> 00:02:37,020 And here I actually also want to create a constant of open draw and a set open drawer equal to our use 27 00:02:37,050 --> 00:02:42,110 state function with the default value of false. 28 00:02:42,280 --> 00:02:50,830 Now I think for clarity's sake we should actually go down and change open to open menu and set open 29 00:02:50,830 --> 00:02:58,720 to set open menu which now means we have to go and change wherever those values are being called. 30 00:02:58,750 --> 00:03:07,300 So let's scroll down and here under handle click change this to set open menu change handle menu item 31 00:03:07,300 --> 00:03:18,760 click to use set open menu set open menu and this is where having iOS lint telling me where these errors 32 00:03:18,760 --> 00:03:19,720 are appearing. 33 00:03:19,720 --> 00:03:23,530 Those little red dots right here makes it very easy. 34 00:03:23,710 --> 00:03:32,710 So open menu on the menu component and I think that that is all of it real quick for clarity's sake. 35 00:03:32,710 --> 00:03:38,200 I would also like to change right here in our handle change function instead of just value here. 36 00:03:38,230 --> 00:03:44,950 Let's change this to new value which is what they had in the documentation so new value which just makes 37 00:03:44,950 --> 00:03:50,870 it a little more clear that we're not referencing this value state right here. 38 00:03:50,950 --> 00:03:55,430 But the new value that's being passed to the function all right. 39 00:03:55,430 --> 00:04:03,500 And now if we scroll down let's go underneath our tabs constant and will create right above the return 40 00:04:03,500 --> 00:04:06,610 statement are constant of Draw. 41 00:04:06,890 --> 00:04:14,300 Set it equal to a meal time line statement with our parentheses and we'll start with a react dot fragment 42 00:04:15,650 --> 00:04:16,390 open that up. 43 00:04:16,760 --> 00:04:22,520 And now we're gonna come back over to the documentation page and we're gonna copy the swipe a ball draw 44 00:04:22,520 --> 00:04:26,210 component that they have for us right here. 45 00:04:26,210 --> 00:04:26,510 So. 46 00:04:26,510 --> 00:04:27,410 Copy that. 47 00:04:27,530 --> 00:04:31,270 Come over and paste it and then go in and where. 48 00:04:31,280 --> 00:04:32,950 It's a self closing tag. 49 00:04:32,960 --> 00:04:40,820 Get rid of that little slash and now create a closing tag and then we're going to open this up. 50 00:04:40,980 --> 00:04:47,310 So again the reason we did that is because these props right here disabled discovery and disable backdrop. 51 00:04:47,310 --> 00:04:52,400 Transition help just optimize for mobile performance. 52 00:04:52,400 --> 00:04:59,950 Now we know the draw component also needs an open prop to determine whether or not the draw is visible. 53 00:05:00,020 --> 00:05:09,960 And we have created the value open draw on our state to manage that then we can set in on Carlos properties 54 00:05:09,990 --> 00:05:13,990 so that the draw knows what to do when we close it. 55 00:05:14,010 --> 00:05:20,940 And in that event we want actually an arrow function and we're just going to make that call are set 56 00:05:21,210 --> 00:05:32,310 open draw two false the opposite of that then is also in on open set equal to another arrow function. 57 00:05:32,390 --> 00:05:35,650 Actually we need to make sure this is outside of that bracket. 58 00:05:35,680 --> 00:05:45,220 So on open and set this prop equal to an arrow function where we are going to set the open draw to true 59 00:05:46,320 --> 00:05:49,820 now to just demonstrate that all of this is working. 60 00:05:49,860 --> 00:05:56,760 Let's go ahead in INSIDE OF THESE swipe a ball draw just place the text example draw and that'll be 61 00:05:56,760 --> 00:05:59,750 enough to see something on the screen. 62 00:05:59,900 --> 00:06:03,920 We still have more to do though before we can use this draw. 63 00:06:03,920 --> 00:06:10,820 And so what's come down outside of the draw but inside of the fragment and we're going to place an icon 64 00:06:11,450 --> 00:06:18,440 button components which means we actually then need to import the icon button component. 65 00:06:18,440 --> 00:06:28,650 So underneath our swipe a ball draw let's import the icon button component from that material dash UI 66 00:06:28,670 --> 00:06:33,250 such core slash icon button. 67 00:06:33,390 --> 00:06:35,630 This does exactly what you think it does. 68 00:06:35,640 --> 00:06:38,180 And I think I've covered it a little bit before. 69 00:06:38,340 --> 00:06:43,920 When we went over the different types of buttons and this just applies all of the buttons styling to 70 00:06:43,920 --> 00:06:46,430 just an icon. 71 00:06:46,470 --> 00:06:52,170 That's exactly what we want for our draw icon which is actually going to be exactly like this material 72 00:06:52,170 --> 00:06:53,260 UI and draw. 73 00:06:53,280 --> 00:06:57,140 Right here you can see they have a temporary draw for their Web site. 74 00:06:57,210 --> 00:07:04,160 But with Icon button imported now we can go back down to our drawer and inside of the icon button will 75 00:07:04,170 --> 00:07:13,690 place our menu icon components that we had in ported that icon button is going to have an on click handler 76 00:07:13,960 --> 00:07:18,720 which is going to call an arrow function which will set our open draw. 77 00:07:18,730 --> 00:07:27,940 Piece of state to not open drawer which will toggle the visibility to true or false based on what is 78 00:07:27,940 --> 00:07:29,380 already set. 79 00:07:29,380 --> 00:07:35,770 So if the draw is open and open draw is set to true it will set it to false closing the door and if 80 00:07:35,770 --> 00:07:42,980 it is already set to false then it will set it to true and cause the drawer to open I also on icon button 81 00:07:42,980 --> 00:07:49,940 wants to add the disable ripple prop because I know I don't want that ripple effect when we click on 82 00:07:49,940 --> 00:07:53,410 the button like it comes with the default style. 83 00:07:53,690 --> 00:07:59,960 With that in place all we should have to do is come down here and where we're rendering our tabs based 84 00:07:59,960 --> 00:08:04,470 on whether or not the screen matches our media query. 85 00:08:04,580 --> 00:08:06,550 Well instead of rendering. 86 00:08:06,560 --> 00:08:15,840 If we are at a medium sized screen or below then we actually want to render our draw if we go ahead 87 00:08:15,870 --> 00:08:20,430 and save this then our application is going to refresh. 88 00:08:20,620 --> 00:08:28,880 And now you can see if I start to resize the screen as soon as our tabs go away we have a menu button 89 00:08:28,890 --> 00:08:36,790 show up if we go ahead and go and click this menu button we can click it and we see our example draw 90 00:08:36,790 --> 00:08:38,470 a pop up over the screen. 91 00:08:39,620 --> 00:08:40,690 So this is great. 92 00:08:40,700 --> 00:08:42,830 We have got our base functionality. 93 00:08:42,830 --> 00:08:49,050 You can see we can click off of it open it back up and you can see the draw is working. 94 00:08:49,110 --> 00:08:53,490 There are obviously a few stylistic things to change though. 95 00:08:53,490 --> 00:08:55,240 The first for me is the. 96 00:08:55,260 --> 00:09:01,370 I don't actually really want to see that circle above the menu icon when you hover over it. 97 00:09:01,380 --> 00:09:07,830 I'd actually really prefer just to have the icon by itself and it's since most people are gonna be on 98 00:09:07,830 --> 00:09:09,550 mobile when they see this. 99 00:09:09,610 --> 00:09:11,850 They're not going to be able to see the hover effect. 100 00:09:11,850 --> 00:09:23,190 Anyways so if we come to our icon button here in the drawer constant and we add a class name of classes 101 00:09:23,460 --> 00:09:35,370 dot draw icon container and then we come up to our styles object and we create the draw icon container 102 00:09:35,460 --> 00:09:37,080 style. 103 00:09:37,080 --> 00:09:47,370 Now I can place R Ampersand colon hover style and when we are hovering over that draw icon I want the 104 00:09:47,400 --> 00:09:51,270 background color to just be transparent. 105 00:09:51,270 --> 00:09:57,200 So if we save this and now the page refreshes we can see when we hover over the icon. 106 00:09:57,300 --> 00:10:05,140 We no longer get that circle of opacity that's good so far but now we obviously don't want this buttons 107 00:10:05,140 --> 00:10:10,990 squished all the way up right against our icon and clearly we would want it on the other side of the 108 00:10:10,990 --> 00:10:16,660 screen here aligned to the right as we saw in all of those examples. 109 00:10:16,660 --> 00:10:20,810 So actually on our draw icon container styling still. 110 00:10:20,950 --> 00:10:29,080 But outside of the hover style let's set our margin left to auto in the same way that we did for the 111 00:10:29,080 --> 00:10:35,790 tabs but make sure that you get that comma underneath there to complete for the hovering style. 112 00:10:35,860 --> 00:10:39,480 So if we go ahead and save that now we'll see the page refresh. 113 00:10:39,670 --> 00:10:43,770 And now our menu icon button is all the way over here on the right. 114 00:10:44,710 --> 00:10:50,770 The last thing that I want to do now is to then make that button a little bit bigger because obviously 115 00:10:50,770 --> 00:10:54,500 that is pretty small and I don't think that that's really what we want. 116 00:10:54,520 --> 00:11:03,160 And so if we come down to the draw constant and on the actual menu icon component itself let's add a 117 00:11:03,160 --> 00:11:14,230 class name to that of equal to classes dot draw icon and now let's go up to our styles object in right 118 00:11:14,260 --> 00:11:16,360 above the draw icon container. 119 00:11:16,450 --> 00:11:23,350 Let's create our draw icon style and make sure you get the comma underneath that and we're just going 120 00:11:23,350 --> 00:11:32,040 to say a height equal to 50 pixels and a width with equal to 50 pixels as well. 121 00:11:32,230 --> 00:11:38,520 If we save that we can now see a much nicer sized button on the screen. 122 00:11:38,540 --> 00:11:40,330 So now we've originally done it. 123 00:11:40,370 --> 00:11:48,110 And you can see if we resize the screen are tabs appear and as we go down and resize the screen is now 124 00:11:48,110 --> 00:11:53,420 much more appropriately handled for any of the sizes that we can move through. 125 00:11:54,400 --> 00:12:01,150 This already is working really great and is hopefully starting to show you the real power and flexibility 126 00:12:01,180 --> 00:12:02,970 of material UI. 127 00:12:03,220 --> 00:12:09,880 And although we have our drawers set up and functioning with our little example draw text. 128 00:12:10,030 --> 00:12:16,230 This obviously is not how we want it to look and not the content that we want to have in our drawer. 129 00:12:16,330 --> 00:12:24,850 And instead we want to move essentially these tabs into our drawer and provide a way for navigation 130 00:12:24,880 --> 00:12:32,620 on the mobile site within here so to do that we're going to use a new material UI component that will 131 00:12:32,620 --> 00:12:35,260 start getting look at in the next video. 14588

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.