Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:06,640 --> 00:00:07,359
so
2
00:00:07,359 --> 00:00:09,440
we'll be creating this um
3
00:00:09,440 --> 00:00:11,040
ecommerce store
4
00:00:11,040 --> 00:00:12,639
in this tutorial
5
00:00:12,639 --> 00:00:15,120
a simple e-commerce site
6
00:00:15,120 --> 00:00:18,720
created with knox and beautify
7
00:00:18,720 --> 00:00:19,520
so
8
00:00:19,520 --> 00:00:21,359
here we have this
9
00:00:21,359 --> 00:00:23,680
carousel
10
00:00:23,680 --> 00:00:25,199
scroll through some of the products that
11
00:00:25,199 --> 00:00:27,279
are on sale
12
00:00:27,279 --> 00:00:28,960
down here we just have one list of
13
00:00:28,960 --> 00:00:31,679
products in a slider
14
00:00:31,679 --> 00:00:34,960
a newsletter box and a photo and of
15
00:00:34,960 --> 00:00:37,200
course you scroll to top thing
16
00:00:37,200 --> 00:00:38,719
button
17
00:00:38,719 --> 00:00:41,360
um click on a product and you carry it
18
00:00:41,360 --> 00:00:43,200
to the details that i put up you can add
19
00:00:43,200 --> 00:00:44,879
it to your cart
20
00:00:44,879 --> 00:00:46,800
here this is the notification from sweet
21
00:00:46,800 --> 00:00:48,399
alert
22
00:00:48,399 --> 00:00:51,199
and then a number pops up on your cart
23
00:00:51,199 --> 00:00:52,879
click it and you see the product here
24
00:00:52,879 --> 00:00:54,559
you can increase or decrease the
25
00:00:54,559 --> 00:00:56,079
quantity
26
00:00:56,079 --> 00:00:57,440
continue to check
27
00:00:57,440 --> 00:01:00,480
other details and then
28
00:01:00,480 --> 00:01:04,239
complete your order
29
00:01:09,920 --> 00:01:13,040
and of course after completing order
30
00:01:13,040 --> 00:01:14,400
clear the cart
31
00:01:14,400 --> 00:01:16,640
and you can shop again
32
00:01:16,640 --> 00:01:20,880
there is this um theme select top here
33
00:01:20,880 --> 00:01:22,560
allows you to switch between light and
34
00:01:22,560 --> 00:01:24,479
dark theme
35
00:01:24,479 --> 00:01:26,720
and if you click on this as a store icon
36
00:01:26,720 --> 00:01:28,799
it takes you to
37
00:01:28,799 --> 00:01:32,240
the products categories on the side
38
00:01:32,240 --> 00:01:34,640
search bar
39
00:01:34,640 --> 00:01:36,640
and then
40
00:01:36,640 --> 00:01:38,079
of course clicking on our products take
41
00:01:38,079 --> 00:01:39,600
it to the details you can add it to your
42
00:01:39,600 --> 00:01:41,280
cart
43
00:01:41,280 --> 00:01:44,079
alright so let's get cracking so head
44
00:01:44,079 --> 00:01:46,720
over water vs code
45
00:01:46,720 --> 00:01:48,720
and we create a new lock stop
46
00:01:48,720 --> 00:01:50,000
with
47
00:01:50,000 --> 00:01:51,360
npx
48
00:01:51,360 --> 00:01:53,119
create
49
00:01:53,119 --> 00:01:55,360
box up
50
00:01:55,360 --> 00:01:57,119
and we're already in the folder all the
51
00:01:57,119 --> 00:02:00,640
files so just use our dots
52
00:02:01,280 --> 00:02:03,200
yes
53
00:02:03,200 --> 00:02:06,399
let's proceed with this
54
00:02:06,399 --> 00:02:07,520
package
55
00:02:07,520 --> 00:02:10,399
let's just name it commerce
56
00:02:10,399 --> 00:02:12,239
i'll be using javascript
57
00:02:12,239 --> 00:02:13,920
npn
58
00:02:13,920 --> 00:02:16,720
beautify as my ui framework i don't need
59
00:02:16,720 --> 00:02:20,080
axios i need pwa
60
00:02:20,080 --> 00:02:22,879
and i'll be using content
61
00:02:22,879 --> 00:02:25,760
just to store the data for the site
62
00:02:25,760 --> 00:02:28,480
um since we're not hooking up to
63
00:02:28,480 --> 00:02:31,120
any server or
64
00:02:31,120 --> 00:02:33,599
anything to get the data for our website
65
00:02:33,599 --> 00:02:34,720
so
66
00:02:34,720 --> 00:02:36,959
content so you press the space bar to
67
00:02:36,959 --> 00:02:40,000
select that that's press enter
68
00:02:40,000 --> 00:02:42,160
uh i already have the pretty extension
69
00:02:42,160 --> 00:02:44,160
installed won't be using any linkedin
70
00:02:44,160 --> 00:02:47,920
tools plus they're annoying so next
71
00:02:47,920 --> 00:02:50,480
uh noticed in
72
00:02:50,480 --> 00:02:54,319
single page because um we can actually
73
00:02:54,319 --> 00:02:58,480
host this on netflix when we're done
74
00:02:58,480 --> 00:02:59,599
static
75
00:02:59,599 --> 00:03:01,920
netfly and it's recommended that you
76
00:03:01,920 --> 00:03:04,959
select the js config
77
00:03:04,959 --> 00:03:07,519
file here so
78
00:03:07,519 --> 00:03:09,840
enter your github username
79
00:03:09,840 --> 00:03:11,840
we'll be using get as a version control
80
00:03:11,840 --> 00:03:13,440
system
81
00:03:13,440 --> 00:03:16,840
let's go and now we have the next app
82
00:03:16,840 --> 00:03:19,200
created um i'm just going to go ahead
83
00:03:19,200 --> 00:03:22,000
and add some dependencies
84
00:03:22,000 --> 00:03:24,799
i'll be adding nox types
85
00:03:24,799 --> 00:03:27,599
um suite alert for the notification
86
00:03:27,599 --> 00:03:29,840
nox web font loader to change the font
87
00:03:29,840 --> 00:03:33,519
from roboto so let me just copy this and
88
00:03:33,519 --> 00:03:36,560
paste it in the terminal
89
00:03:36,560 --> 00:03:38,480
so we have nox types
90
00:03:38,480 --> 00:03:40,959
this will help us with the types in nox
91
00:03:40,959 --> 00:03:42,879
this is the ui um
92
00:03:42,879 --> 00:03:45,760
package for sweetheart the material one
93
00:03:45,760 --> 00:03:47,280
web phone loader of course to change the
94
00:03:47,280 --> 00:03:50,400
fonts views which are to show the toasts
95
00:03:50,400 --> 00:03:52,400
and pop-ups
96
00:03:52,400 --> 00:03:55,599
so let's go with those
97
00:03:55,599 --> 00:03:58,239
all right so once they're installed
98
00:03:58,239 --> 00:04:01,120
what i like to do is to just configure
99
00:04:01,120 --> 00:04:02,879
as much as i can in
100
00:04:02,879 --> 00:04:03,640
the
101
00:04:03,640 --> 00:04:06,480
noxconfig.js file here
102
00:04:06,480 --> 00:04:07,760
so
103
00:04:07,760 --> 00:04:10,480
usually just remove this
104
00:04:10,480 --> 00:04:12,879
title template if i'm not
105
00:04:12,879 --> 00:04:14,959
using
106
00:04:14,959 --> 00:04:17,358
if i'm not worried about seo
107
00:04:17,358 --> 00:04:20,079
um just call this free
108
00:04:20,079 --> 00:04:21,759
commerce
109
00:04:21,759 --> 00:04:23,230
you can add a description here
110
00:04:23,230 --> 00:04:25,120
[Music]
111
00:04:25,120 --> 00:04:27,440
the commerce website
112
00:04:27,440 --> 00:04:29,040
it doesn't matter
113
00:04:29,040 --> 00:04:31,040
uh
114
00:04:31,040 --> 00:04:33,360
css
115
00:04:33,360 --> 00:04:36,080
do i want any css in this app yeah let's
116
00:04:36,080 --> 00:04:37,759
add
117
00:04:37,759 --> 00:04:40,479
css files call it main
118
00:04:40,479 --> 00:04:42,080
css
119
00:04:42,080 --> 00:04:45,440
and just copy the path
120
00:04:46,400 --> 00:04:49,280
and add it here
121
00:04:51,520 --> 00:04:53,680
good i need to add a few modules to this
122
00:04:53,680 --> 00:04:56,800
thing so let me see what modules do i
123
00:04:56,800 --> 00:04:57,680
need
124
00:04:57,680 --> 00:04:59,919
i need the
125
00:04:59,919 --> 00:05:02,240
nox web for noda module
126
00:05:02,240 --> 00:05:03,840
the
127
00:05:03,840 --> 00:05:06,639
sweet alert module as well so let me
128
00:05:06,639 --> 00:05:07,520
just
129
00:05:07,520 --> 00:05:09,520
get those and add them here
130
00:05:09,520 --> 00:05:12,000
so just press this in here
131
00:05:12,000 --> 00:05:14,639
and there's no css um it's coming from
132
00:05:14,639 --> 00:05:16,720
the documentation from view sweetheart
133
00:05:16,720 --> 00:05:18,880
too if you want to use this in nox with
134
00:05:18,880 --> 00:05:20,160
a different
135
00:05:20,160 --> 00:05:21,360
theme
136
00:05:21,360 --> 00:05:24,240
um you have to add this no css to the
137
00:05:24,240 --> 00:05:26,400
end of the module name
138
00:05:26,400 --> 00:05:27,759
uh
139
00:05:27,759 --> 00:05:29,520
since we added the
140
00:05:29,520 --> 00:05:31,280
material ui
141
00:05:31,280 --> 00:05:33,120
theme for
142
00:05:33,120 --> 00:05:35,600
sweet alerts we can just add that in the
143
00:05:35,600 --> 00:05:39,199
css array as well
144
00:05:39,199 --> 00:05:41,840
so let's just paste this here we need to
145
00:05:41,840 --> 00:05:44,240
configure web phone loader um you can
146
00:05:44,240 --> 00:05:45,840
check out the documentation for web
147
00:05:45,840 --> 00:05:47,039
phone holder i just added to the
148
00:05:47,039 --> 00:05:48,240
description
149
00:05:48,240 --> 00:05:51,280
um but essentially you can use any um
150
00:05:51,280 --> 00:05:53,039
the free fonts on google
151
00:05:53,039 --> 00:05:55,440
so let me just put the configuration
152
00:05:55,440 --> 00:05:57,919
for the font that i'll be using
153
00:05:57,919 --> 00:06:00,880
in here i'll be using dm suns
154
00:06:00,880 --> 00:06:02,880
actually i like this font i think it's
155
00:06:02,880 --> 00:06:05,680
the font that um nox uses on their
156
00:06:05,680 --> 00:06:08,400
official website i actually like it the
157
00:06:08,400 --> 00:06:10,160
beautify object
158
00:06:10,160 --> 00:06:12,639
if you visit this website
159
00:06:12,639 --> 00:06:14,400
um
160
00:06:14,400 --> 00:06:16,720
where you can find a documentation for
161
00:06:16,720 --> 00:06:19,520
the beautiful module for nox they'll
162
00:06:19,520 --> 00:06:21,520
actually show you how you can configure
163
00:06:21,520 --> 00:06:23,680
different parts of the
164
00:06:23,680 --> 00:06:25,440
the modules so the first thing i like to
165
00:06:25,440 --> 00:06:28,000
add is tree shaking
166
00:06:28,000 --> 00:06:30,080
and set that to true and then the
167
00:06:30,080 --> 00:06:32,479
default assets in the default assets
168
00:06:32,479 --> 00:06:33,600
object
169
00:06:33,600 --> 00:06:36,720
you get to specify the font as well as a
170
00:06:36,720 --> 00:06:39,199
default font size and i think this will
171
00:06:39,199 --> 00:06:40,400
override the
172
00:06:40,400 --> 00:06:42,560
font size that beautify set
173
00:06:42,560 --> 00:06:45,440
the global font size so yeah let's let's
174
00:06:45,440 --> 00:06:47,120
work with that
175
00:06:47,120 --> 00:06:50,560
the next thing i like to change is my
176
00:06:50,560 --> 00:06:52,880
feminine so i'll change this from dark
177
00:06:52,880 --> 00:06:55,199
to light
178
00:06:55,199 --> 00:06:57,440
of course these are the lights and i'll
179
00:06:57,440 --> 00:07:00,080
be using
180
00:07:00,080 --> 00:07:03,120
deep purple because i actually like
181
00:07:03,120 --> 00:07:04,400
purple
182
00:07:04,400 --> 00:07:08,080
um with the dark and one version
183
00:07:08,080 --> 00:07:10,319
i'm going to actually add
184
00:07:10,319 --> 00:07:12,160
a
185
00:07:12,160 --> 00:07:14,800
custom color in this object
186
00:07:14,800 --> 00:07:16,080
so i can use it throughout the
187
00:07:16,080 --> 00:07:17,360
application
188
00:07:17,360 --> 00:07:20,479
um for the light theme
189
00:07:20,479 --> 00:07:23,919
the background color will be white
190
00:07:23,919 --> 00:07:25,360
is that white
191
00:07:25,360 --> 00:07:28,720
wait not too many f's one two three four
192
00:07:28,720 --> 00:07:31,599
five six are good and i'm going to add a
193
00:07:31,599 --> 00:07:34,880
surface color as well
194
00:07:34,880 --> 00:07:37,199
so this color will be used for like um
195
00:07:37,199 --> 00:07:40,000
elevated services like cards and
196
00:07:40,000 --> 00:07:45,520
nav bars etc so let's go sir
197
00:07:45,520 --> 00:07:47,840
i can't spell very good
198
00:07:47,840 --> 00:07:50,639
and then let me just copy this down
199
00:07:50,639 --> 00:07:53,680
create a dark variant
200
00:07:53,680 --> 00:07:55,759
of course i'm going to use the same
201
00:07:55,759 --> 00:07:59,199
primary color and for the background
202
00:07:59,199 --> 00:08:02,160
color i'm gonna use this one
203
00:08:02,160 --> 00:08:03,759
and for
204
00:08:03,759 --> 00:08:06,400
the surface color for the dark
205
00:08:06,400 --> 00:08:07,520
theme
206
00:08:07,520 --> 00:08:11,120
oh i'm gonna use this one
207
00:08:11,520 --> 00:08:14,680
uh that's it for the most part for
208
00:08:14,680 --> 00:08:17,520
configuration let's just say this
209
00:08:17,520 --> 00:08:19,919
if you would like you can actually add
210
00:08:19,919 --> 00:08:22,319
configuration for the pwa
211
00:08:22,319 --> 00:08:23,759
module here
212
00:08:23,759 --> 00:08:26,560
all right so let's go to cleaning up
213
00:08:26,560 --> 00:08:29,919
some of these files so we can close this
214
00:08:29,919 --> 00:08:33,279
and then we go to components i won't be
215
00:08:33,279 --> 00:08:36,000
using any of these components
216
00:08:36,000 --> 00:08:38,000
so let me just
217
00:08:38,000 --> 00:08:41,479
select all
218
00:08:41,839 --> 00:08:43,039
uh
219
00:08:43,039 --> 00:08:45,040
for the
220
00:08:45,040 --> 00:08:47,120
layouts
221
00:08:47,120 --> 00:08:48,560
i
222
00:08:48,560 --> 00:08:51,279
will just remove the default layout
223
00:08:51,279 --> 00:08:52,959
all right good
224
00:08:52,959 --> 00:08:57,360
and i don't need this inspire page
225
00:08:57,680 --> 00:09:00,240
i don't need this um
226
00:09:00,240 --> 00:09:03,200
in my template so
227
00:09:03,200 --> 00:09:06,080
let me just create a new template
228
00:09:06,080 --> 00:09:08,399
see that empty for no
229
00:09:08,399 --> 00:09:11,040
and let's configure the error page
230
00:09:11,040 --> 00:09:15,600
all right so error page i don't like
231
00:09:15,600 --> 00:09:16,800
this thing
232
00:09:16,800 --> 00:09:18,000
because
233
00:09:18,000 --> 00:09:22,800
this default error um page just shows
234
00:09:22,800 --> 00:09:25,360
a text with a link in the top left
235
00:09:25,360 --> 00:09:28,240
corner of the page i don't like that
236
00:09:28,240 --> 00:09:29,279
so
237
00:09:29,279 --> 00:09:31,839
let's let's let's let's update this
238
00:09:31,839 --> 00:09:34,720
i want my error page to
239
00:09:34,720 --> 00:09:37,200
look something like this just a page
240
00:09:37,200 --> 00:09:38,480
with the text
241
00:09:38,480 --> 00:09:39,519
nicely
242
00:09:39,519 --> 00:09:41,200
formatted in the middle
243
00:09:41,200 --> 00:09:43,279
um with error message
244
00:09:43,279 --> 00:09:46,080
showing exactly what went wrong
245
00:09:46,080 --> 00:09:48,240
so
246
00:09:48,399 --> 00:09:50,959
we continue
247
00:09:50,959 --> 00:09:53,519
probably give us a class
248
00:09:53,519 --> 00:09:56,560
fill the heights
249
00:09:57,920 --> 00:10:00,160
v-roll
250
00:10:00,160 --> 00:10:04,760
and justify this raw center
251
00:10:14,240 --> 00:10:15,120
all right
252
00:10:15,120 --> 00:10:16,560
message
253
00:10:16,560 --> 00:10:19,560
oops
254
00:10:22,399 --> 00:10:25,920
something what's wrong
255
00:10:27,920 --> 00:10:30,920
here
256
00:10:33,519 --> 00:10:36,959
and then show the error message
257
00:10:36,959 --> 00:10:38,480
and the error messages coming from this
258
00:10:38,480 --> 00:10:40,800
error prop that's passed in whenever an
259
00:10:40,800 --> 00:10:43,360
error is strongly knocks
260
00:10:43,360 --> 00:10:44,160
so
261
00:10:44,160 --> 00:10:47,839
error got message
262
00:10:47,839 --> 00:10:51,440
uh let's style this thing a little
263
00:10:51,440 --> 00:10:52,240
so
264
00:10:52,240 --> 00:10:54,399
you want red
265
00:10:54,399 --> 00:10:56,880
text
266
00:10:57,360 --> 00:10:58,560
that works
267
00:10:58,560 --> 00:11:01,040
and let's just create a button
268
00:11:01,040 --> 00:11:04,000
that will redirect our user to the home
269
00:11:04,000 --> 00:11:06,399
page so that's slash
270
00:11:06,399 --> 00:11:07,279
um
271
00:11:07,279 --> 00:11:11,320
capitalize the text here
272
00:11:21,680 --> 00:11:23,120
good
273
00:11:23,120 --> 00:11:25,040
now let's run our app and see what it
274
00:11:25,040 --> 00:11:26,240
looks like
275
00:11:26,240 --> 00:11:29,360
and camera on dev or yarn div if you're
276
00:11:29,360 --> 00:11:31,360
using yarn
277
00:11:31,360 --> 00:11:34,880
all right so we can go to localhost 3000
278
00:11:34,880 --> 00:11:38,399
uh we should see our application
279
00:11:38,399 --> 00:11:41,800
let's go
280
00:11:43,920 --> 00:11:46,320
so open a new tab
281
00:11:46,320 --> 00:11:49,760
localhost 3000 and here is our app
282
00:11:49,760 --> 00:11:51,680
and it's displaying the index page of
283
00:11:51,680 --> 00:11:54,160
course in our index page we had nothing
284
00:11:54,160 --> 00:11:56,800
so it's showing nothing uh but if we
285
00:11:56,800 --> 00:11:58,560
should go to a row that doesn't exist
286
00:11:58,560 --> 00:12:01,200
just to show the error page
287
00:12:01,200 --> 00:12:02,880
here we go
288
00:12:02,880 --> 00:12:04,320
i guess we can make this button primary
289
00:12:04,320 --> 00:12:06,480
column
290
00:12:06,480 --> 00:12:10,200
primary color button
291
00:12:18,320 --> 00:12:20,560
if we go back to here yep
292
00:12:20,560 --> 00:12:22,560
so the messages this page could not be
293
00:12:22,560 --> 00:12:24,399
found
294
00:12:24,399 --> 00:12:26,320
all right that works for me so let's go
295
00:12:26,320 --> 00:12:27,360
home
296
00:12:27,360 --> 00:12:30,240
to our blog page
297
00:12:30,720 --> 00:12:32,399
alright so
298
00:12:32,399 --> 00:12:34,880
the app is up and running
299
00:12:34,880 --> 00:12:36,800
we removed some of the defaults
300
00:12:36,800 --> 00:12:38,639
configuration
301
00:12:38,639 --> 00:12:43,120
what's next let's add some
302
00:12:43,120 --> 00:12:46,800
data to our content folder all right so
303
00:12:46,800 --> 00:12:49,360
nox content is this awesome module that
304
00:12:49,360 --> 00:12:50,880
allows you to
305
00:12:50,880 --> 00:12:51,839
store
306
00:12:51,839 --> 00:12:55,040
data in this content folder and you can
307
00:12:55,040 --> 00:12:58,480
actually call that data it act as a
308
00:12:58,480 --> 00:13:00,880
server type of thing
309
00:13:00,880 --> 00:13:03,480
so what we will do is we'll create a
310
00:13:03,480 --> 00:13:07,480
products folder
311
00:13:09,200 --> 00:13:13,200
and then i'll add our products.json
312
00:13:13,200 --> 00:13:16,480
file inside this folder
313
00:13:16,480 --> 00:13:20,160
so right click new file
314
00:13:23,120 --> 00:13:25,360
and i already have some products here so
315
00:13:25,360 --> 00:13:27,519
let me just add them in like i said
316
00:13:27,519 --> 00:13:31,279
earlier the images are coming from pixel
317
00:13:31,279 --> 00:13:34,639
um i have five products here
318
00:13:34,639 --> 00:13:37,040
and just so we are familiar with the
319
00:13:37,040 --> 00:13:39,920
properties you all have a unique id
320
00:13:39,920 --> 00:13:42,399
name if they're on sale or not
321
00:13:42,399 --> 00:13:45,360
the tags for the product image url
322
00:13:45,360 --> 00:13:47,360
descriptions just some learn with some
323
00:13:47,360 --> 00:13:50,320
text price sale price
324
00:13:50,320 --> 00:13:52,639
and greetings
325
00:13:52,639 --> 00:13:54,480
all right so we have five of these let's
326
00:13:54,480 --> 00:13:56,720
save that
327
00:13:56,720 --> 00:13:59,360
um we also want to create a character
328
00:13:59,360 --> 00:14:01,279
corey's
329
00:14:01,279 --> 00:14:02,800
folder
330
00:14:02,800 --> 00:14:05,360
so let's just create a new file
331
00:14:05,360 --> 00:14:06,880
wait i think this has been created in
332
00:14:06,880 --> 00:14:08,240
products
333
00:14:08,240 --> 00:14:10,240
it's a new file
334
00:14:10,240 --> 00:14:12,639
okay
335
00:14:14,000 --> 00:14:17,000
slash
336
00:14:21,040 --> 00:14:23,440
and of course
337
00:14:23,440 --> 00:14:25,920
let's just copy these
338
00:14:25,920 --> 00:14:28,399
over
339
00:14:28,399 --> 00:14:30,560
so each category
340
00:14:30,560 --> 00:14:32,320
you have an id
341
00:14:32,320 --> 00:14:34,959
a name and an image
342
00:14:34,959 --> 00:14:38,480
and this is what we'll show on the
343
00:14:38,480 --> 00:14:40,480
product
344
00:14:40,480 --> 00:14:42,839
index page yeah
345
00:14:42,839 --> 00:14:45,839
so when you go to search for a product
346
00:14:45,839 --> 00:14:49,199
these categories will be on the left
347
00:14:49,199 --> 00:14:52,240
so let's just save that save this
348
00:14:52,240 --> 00:14:54,480
and close the error
349
00:14:54,480 --> 00:14:55,600
and
350
00:14:55,600 --> 00:14:59,839
let's just restart our server
351
00:15:00,720 --> 00:15:03,360
getting some more in messages from or
352
00:15:03,360 --> 00:15:05,040
console
353
00:15:05,040 --> 00:15:07,040
something about the
354
00:15:07,040 --> 00:15:09,120
json format let's see what's wrong with
355
00:15:09,120 --> 00:15:10,720
just a follow-up letter as well just a
356
00:15:10,720 --> 00:15:13,040
format
357
00:15:13,040 --> 00:15:14,959
i think we just need to restart all
358
00:15:14,959 --> 00:15:15,839
right
359
00:15:15,839 --> 00:15:18,880
and let's just restart
360
00:15:21,440 --> 00:15:23,600
all right no warnings all right let's
361
00:15:23,600 --> 00:15:26,560
just jump back to the website
362
00:15:26,560 --> 00:15:30,639
to see if we'll get anyone in there
363
00:15:30,639 --> 00:15:32,959
oh no not in here let's just refresh all
364
00:15:32,959 --> 00:15:34,959
right i think we're good
365
00:15:34,959 --> 00:15:37,680
all right so since we have no warnings
366
00:15:37,680 --> 00:15:38,560
let's
367
00:15:38,560 --> 00:15:41,040
add or nav bar
368
00:15:41,040 --> 00:15:44,320
to the application so
369
00:15:44,320 --> 00:15:47,360
we just go to the components folder and
370
00:15:47,360 --> 00:15:50,320
create a new file called nav
371
00:15:50,320 --> 00:15:52,639
view
372
00:15:53,440 --> 00:15:55,279
and in here
373
00:15:55,279 --> 00:15:58,720
we'll just add or a bar
374
00:15:58,720 --> 00:16:00,880
and give it a few props so the first one
375
00:16:00,880 --> 00:16:03,839
i want to give it is the color prop
376
00:16:03,839 --> 00:16:04,800
and
377
00:16:04,800 --> 00:16:06,800
this will be the surface
378
00:16:06,800 --> 00:16:08,720
color that we added to our
379
00:16:08,720 --> 00:16:10,800
beautify configuration let's give it a
380
00:16:10,800 --> 00:16:13,279
height of about 80
381
00:16:13,279 --> 00:16:15,199
on the class
382
00:16:15,199 --> 00:16:16,800
of l
383
00:16:16,800 --> 00:16:19,120
this class i like to create
384
00:16:19,120 --> 00:16:21,759
in or main.css file because i don't like
385
00:16:21,759 --> 00:16:22,560
the
386
00:16:22,560 --> 00:16:25,199
the default um elevation that comes with
387
00:16:25,199 --> 00:16:26,959
the nav bar so
388
00:16:26,959 --> 00:16:30,399
let's just give this box shadow
389
00:16:30,399 --> 00:16:31,440
of
390
00:16:31,440 --> 00:16:34,839
zero pixels for pixels
391
00:16:34,839 --> 00:16:36,399
um
392
00:16:36,399 --> 00:16:38,320
10
393
00:16:38,320 --> 00:16:40,079
the radius of 10
394
00:16:40,079 --> 00:16:43,920
and the color will be
395
00:16:43,920 --> 00:16:46,240
zero
396
00:16:47,519 --> 00:16:50,240
zero zero 0
397
00:16:50,240 --> 00:16:52,720
0.08
398
00:16:52,720 --> 00:16:54,959
this mean is important so that overrides
399
00:16:54,959 --> 00:16:56,399
the
400
00:16:56,399 --> 00:16:59,199
elevation from beautify um another class
401
00:16:59,199 --> 00:17:00,720
that i'd like to add
402
00:17:00,720 --> 00:17:03,600
is this call class this class called
403
00:17:03,600 --> 00:17:05,039
pointer
404
00:17:05,039 --> 00:17:07,280
um
405
00:17:07,439 --> 00:17:08,400
it
406
00:17:08,400 --> 00:17:11,280
just sets the curse of the pointer
407
00:17:11,280 --> 00:17:13,520
for different paragraphs that i want to
408
00:17:13,520 --> 00:17:14,959
add a click
409
00:17:14,959 --> 00:17:18,480
um thing to so let's just save that
410
00:17:18,480 --> 00:17:20,559
so l here
411
00:17:20,559 --> 00:17:21,919
um
412
00:17:21,919 --> 00:17:24,640
let's add the up prop and this basically
413
00:17:24,640 --> 00:17:25,919
just
414
00:17:25,919 --> 00:17:27,599
adds the
415
00:17:27,599 --> 00:17:30,880
fix position fixed down to the
416
00:17:30,880 --> 00:17:32,960
up bar and keeps it at the top of the
417
00:17:32,960 --> 00:17:34,320
application
418
00:17:34,320 --> 00:17:35,200
uh
419
00:17:35,200 --> 00:17:37,520
another thing that i want to do
420
00:17:37,520 --> 00:17:38,480
like that
421
00:17:38,480 --> 00:17:40,160
is to add
422
00:17:40,160 --> 00:17:42,640
um styling based on the break point of
423
00:17:42,640 --> 00:17:44,960
our application so i have to bind the
424
00:17:44,960 --> 00:17:46,720
style
425
00:17:46,720 --> 00:17:50,240
and we'll pass it on object
426
00:17:50,240 --> 00:17:51,840
and the cell that we want to adjust is
427
00:17:51,840 --> 00:17:53,039
the padding
428
00:17:53,039 --> 00:17:54,960
so we'll just say
429
00:17:54,960 --> 00:17:57,120
we want
430
00:17:57,120 --> 00:17:59,760
the pattern to be
431
00:17:59,760 --> 00:18:02,000
x while we're
432
00:18:02,000 --> 00:18:04,320
at this breakpoint so for me
433
00:18:04,320 --> 00:18:07,600
i'm just going to say beautify
434
00:18:07,600 --> 00:18:09,280
dot breakpoint
435
00:18:09,280 --> 00:18:11,360
dot
436
00:18:11,360 --> 00:18:15,360
md and up so we're going to check if the
437
00:18:15,360 --> 00:18:18,720
break point is medium on up and if it is
438
00:18:18,720 --> 00:18:21,120
we'll say that we want the part to be
439
00:18:21,120 --> 00:18:22,960
zero
440
00:18:22,960 --> 00:18:26,320
pixels top and bottom 100 pixels
441
00:18:26,320 --> 00:18:27,679
left and right
442
00:18:27,679 --> 00:18:29,679
if it's not medium or not then just
443
00:18:29,679 --> 00:18:31,200
leave it blank
444
00:18:31,200 --> 00:18:34,160
that's all this is saying
445
00:18:34,240 --> 00:18:36,559
all right so we can close
446
00:18:36,559 --> 00:18:39,840
the app bar tag
447
00:18:39,919 --> 00:18:42,880
and let's just add this to
448
00:18:42,880 --> 00:18:44,880
this component to our
449
00:18:44,880 --> 00:18:47,280
um index file so let's copy the relative
450
00:18:47,280 --> 00:18:49,600
part
451
00:18:49,600 --> 00:18:52,240
go to index
452
00:18:52,240 --> 00:18:56,360
and paste it here
453
00:18:57,039 --> 00:18:58,960
and this will work without actually
454
00:18:58,960 --> 00:19:00,000
doing
455
00:19:00,000 --> 00:19:01,600
um import
456
00:19:01,600 --> 00:19:03,679
blood on here
457
00:19:03,679 --> 00:19:06,720
because of
458
00:19:07,679 --> 00:19:09,520
the components
459
00:19:09,520 --> 00:19:12,400
module that was added to nox recently um
460
00:19:12,400 --> 00:19:14,000
once you set components to true in your
461
00:19:14,000 --> 00:19:16,320
next config file it will automatically
462
00:19:16,320 --> 00:19:17,840
import
463
00:19:17,840 --> 00:19:21,360
your components so let's just save this
464
00:19:21,360 --> 00:19:23,760
and see what's happening on
465
00:19:23,760 --> 00:19:25,919
the website
466
00:19:25,919 --> 00:19:28,480
so you can see here we have
467
00:19:28,480 --> 00:19:30,480
a surface
468
00:19:30,480 --> 00:19:32,480
color of
469
00:19:32,480 --> 00:19:35,280
the dark surface color that we set
470
00:19:35,280 --> 00:19:36,400
and
471
00:19:36,400 --> 00:19:39,360
i think this is because let me just
472
00:19:39,360 --> 00:19:40,880
close the demo up i think this is
473
00:19:40,880 --> 00:19:42,640
because
474
00:19:42,640 --> 00:19:46,960
we have the application set to dark so
475
00:19:46,960 --> 00:19:50,400
let's just check back on that in vs code
476
00:19:50,400 --> 00:19:53,520
so in default we have dark here i think
477
00:19:53,520 --> 00:19:56,000
that can stay as dark i mean on nox
478
00:19:56,000 --> 00:19:58,240
config
479
00:19:58,240 --> 00:20:01,760
we have light set to true
480
00:20:04,320 --> 00:20:07,600
the surface is oh oh oh okay so this
481
00:20:07,600 --> 00:20:09,360
should actually be dark
482
00:20:09,360 --> 00:20:11,919
not light
483
00:20:13,840 --> 00:20:16,240
so once you update this
484
00:20:16,240 --> 00:20:19,559
the up restarts
485
00:20:21,919 --> 00:20:24,400
then we should see
486
00:20:24,400 --> 00:20:27,120
that this thing is white refresh
487
00:20:27,120 --> 00:20:29,120
and it's white and this is the elevation
488
00:20:29,120 --> 00:20:32,240
that i like on my application
489
00:20:32,240 --> 00:20:34,960
the next thing that we want to do is to
490
00:20:34,960 --> 00:20:37,039
actually add
491
00:20:37,039 --> 00:20:38,880
the background color for the application
492
00:20:38,880 --> 00:20:41,360
when it's in dark and light mode
493
00:20:41,360 --> 00:20:43,200
so to do that
494
00:20:43,200 --> 00:20:46,840
we can just go to the layouts
495
00:20:46,840 --> 00:20:50,400
folder where's the little swallow
496
00:20:50,400 --> 00:20:53,200
and go to default and update
497
00:20:53,200 --> 00:20:56,080
the styling here
498
00:20:56,080 --> 00:20:58,240
so
499
00:20:58,240 --> 00:21:00,559
we're just gonna add this um we're gonna
500
00:21:00,559 --> 00:21:03,280
bind this style again pass in an object
501
00:21:03,280 --> 00:21:04,799
and this time we'll pass in the
502
00:21:04,799 --> 00:21:06,480
background
503
00:21:06,480 --> 00:21:08,960
color
504
00:21:10,559 --> 00:21:11,840
and for
505
00:21:11,840 --> 00:21:14,640
css properties that are hyphenated you
506
00:21:14,640 --> 00:21:16,400
have to use um
507
00:21:16,400 --> 00:21:17,919
camera keys
508
00:21:17,919 --> 00:21:20,080
when you're passing them in an object to
509
00:21:20,080 --> 00:21:21,840
the to the style here once you're
510
00:21:21,840 --> 00:21:23,520
binding it like this
511
00:21:23,520 --> 00:21:26,880
so we're gonna check again
512
00:21:26,880 --> 00:21:30,480
if we are using the light or dark mode
513
00:21:30,480 --> 00:21:32,559
from beautify and then we'll
514
00:21:32,559 --> 00:21:33,919
display
515
00:21:33,919 --> 00:21:36,080
a background color based on that so
516
00:21:36,080 --> 00:21:38,400
we're going to say here to find
517
00:21:38,400 --> 00:21:39,679
dot
518
00:21:39,679 --> 00:21:42,159
theme
519
00:21:42,799 --> 00:21:44,080
so this will check if we're using the
520
00:21:44,080 --> 00:21:45,200
dark theme
521
00:21:45,200 --> 00:21:46,640
and if we're using the dark theme we
522
00:21:46,640 --> 00:21:49,280
want to use this color if not
523
00:21:49,280 --> 00:21:52,400
we're going to use white
524
00:21:53,440 --> 00:21:54,640
so
525
00:21:54,640 --> 00:21:56,880
let's just paste in our
526
00:21:56,880 --> 00:21:59,280
color
527
00:22:07,200 --> 00:22:09,120
the next thing i want to add is the
528
00:22:09,120 --> 00:22:11,039
title for the website
529
00:22:11,039 --> 00:22:12,880
and for that i'll use
530
00:22:12,880 --> 00:22:15,039
a component from beautify
531
00:22:15,039 --> 00:22:19,039
carvie toolbar title
532
00:22:19,200 --> 00:22:23,679
and in this i'm just going to add the
533
00:22:23,679 --> 00:22:26,720
word free e-commerce
534
00:22:26,720 --> 00:22:29,280
and add some style to this
535
00:22:29,280 --> 00:22:34,320
so i'm gonna add a class of text
536
00:22:34,720 --> 00:22:36,559
md
537
00:22:36,559 --> 00:22:37,679
h5
538
00:22:37,679 --> 00:22:40,320
um what this md represents is medium and
539
00:22:40,320 --> 00:22:41,039
up
540
00:22:41,039 --> 00:22:44,720
it should be h5 and on the lowest um
541
00:22:44,720 --> 00:22:47,200
medium on low or less than medium size
542
00:22:47,200 --> 00:22:48,159
screen
543
00:22:48,159 --> 00:22:50,400
um it should just use the default
544
00:22:50,400 --> 00:22:52,880
text style for this i want the font to
545
00:22:52,880 --> 00:22:56,320
it to be bored as well
546
00:22:56,720 --> 00:22:59,200
and i'm going to add that pointer class
547
00:22:59,200 --> 00:23:00,799
because when you click on this thing i
548
00:23:00,799 --> 00:23:03,200
wanted to take you to the home page
549
00:23:03,200 --> 00:23:05,520
notes other functionality we just call
550
00:23:05,520 --> 00:23:06,799
the click
551
00:23:06,799 --> 00:23:08,960
method on this
552
00:23:08,960 --> 00:23:10,000
element
553
00:23:10,000 --> 00:23:12,720
and we're going to call route saw dollar
554
00:23:12,720 --> 00:23:14,000
sign router
555
00:23:14,000 --> 00:23:15,600
and we're going to push
556
00:23:15,600 --> 00:23:16,880
to
557
00:23:16,880 --> 00:23:18,480
the
558
00:23:18,480 --> 00:23:20,159
index page
559
00:23:20,159 --> 00:23:21,679
so we can save that
560
00:23:21,679 --> 00:23:24,559
and check to see if it's showing on or
561
00:23:24,559 --> 00:23:27,120
browser
562
00:23:29,440 --> 00:23:31,200
there it is and you can see the cursor
563
00:23:31,200 --> 00:23:33,280
change to points here
564
00:23:33,280 --> 00:23:36,559
so if you weren't on this page
565
00:23:36,880 --> 00:23:39,840
and click on the free commerce
566
00:23:39,840 --> 00:23:41,039
title here
567
00:23:41,039 --> 00:23:43,919
it would take us to the homepage
568
00:23:43,919 --> 00:23:46,880
back to vs code
569
00:23:47,600 --> 00:23:50,720
so the next thing we want to add
570
00:23:50,720 --> 00:23:53,760
are the actual buttons
571
00:23:53,760 --> 00:23:54,559
so
572
00:23:54,559 --> 00:23:58,000
i want some space between the title and
573
00:23:58,000 --> 00:24:02,559
the buttons so just out of v spacer here
574
00:24:02,960 --> 00:24:07,200
and then i'll add my icon bonds
575
00:24:09,600 --> 00:24:11,840
and
576
00:24:11,840 --> 00:24:15,279
we just want to add the icons so add the
577
00:24:15,279 --> 00:24:16,480
icon
578
00:24:16,480 --> 00:24:18,240
i'm gonna change the size of the icons
579
00:24:18,240 --> 00:24:20,640
because by default i think they're 24.
580
00:24:20,640 --> 00:24:23,440
so i'm just going to change them to 20
581
00:24:23,440 --> 00:24:29,120
and then call the icon says mdi store
582
00:24:29,120 --> 00:24:30,480
all the line
583
00:24:30,480 --> 00:24:33,840
for the first icon
584
00:24:33,840 --> 00:24:37,440
and then let's copy this down
585
00:24:37,520 --> 00:24:41,600
and i want the cards icon x
586
00:24:42,080 --> 00:24:44,960
after the card icon i want to divide
587
00:24:44,960 --> 00:24:47,840
there
588
00:24:47,919 --> 00:24:51,200
and this will be a vertical level
589
00:24:51,200 --> 00:24:53,600
with some margin because i want some
590
00:24:53,600 --> 00:24:54,880
space between the divider and the
591
00:24:54,880 --> 00:24:57,279
buttons
592
00:24:57,279 --> 00:24:59,520
all right so the class the class is
593
00:24:59,520 --> 00:25:01,120
going to be
594
00:25:01,120 --> 00:25:03,200
um
595
00:25:03,200 --> 00:25:05,600
mx
596
00:25:05,600 --> 00:25:09,120
for medium and up we wanted to be five
597
00:25:09,120 --> 00:25:11,840
and for smaller screens we just want to
598
00:25:11,840 --> 00:25:14,320
not so much space between them and then
599
00:25:14,320 --> 00:25:16,799
now we're gonna add
600
00:25:16,799 --> 00:25:19,760
the last one in or
601
00:25:19,760 --> 00:25:22,400
up bar and this is just gonna
602
00:25:22,400 --> 00:25:24,240
toggle the
603
00:25:24,240 --> 00:25:26,080
um the theme
604
00:25:26,080 --> 00:25:28,400
so we're gonna use this icon called
605
00:25:28,400 --> 00:25:31,120
brightness
606
00:25:31,120 --> 00:25:33,520
seven
607
00:25:33,679 --> 00:25:35,039
all right so let's save it and see what
608
00:25:35,039 --> 00:25:37,600
it looks like
609
00:25:39,600 --> 00:25:42,320
and as you can see we have more icons
610
00:25:42,320 --> 00:25:44,720
here not doing anything just yet
611
00:25:44,720 --> 00:25:46,960
but they're working
612
00:25:46,960 --> 00:25:48,559
let's just zoom in a little so you guys
613
00:25:48,559 --> 00:25:51,360
can see what's happening
614
00:25:52,480 --> 00:25:55,640
all right
615
00:25:56,159 --> 00:25:58,559
now that we have the nav bar set up for
616
00:25:58,559 --> 00:26:00,559
the most part i think we can create a
617
00:26:00,559 --> 00:26:02,559
photo
618
00:26:02,559 --> 00:26:04,080
so
619
00:26:04,080 --> 00:26:06,400
let's just create our footer files
620
00:26:06,400 --> 00:26:07,360
um
621
00:26:07,360 --> 00:26:09,200
i'm just going to create a new component
622
00:26:09,200 --> 00:26:12,600
called footsong.view
623
00:26:14,159 --> 00:26:17,039
and in the photo
624
00:26:17,039 --> 00:26:18,480
i'm just gonna
625
00:26:18,480 --> 00:26:21,919
create a card
626
00:26:23,200 --> 00:26:24,799
we want this card to be
627
00:26:24,799 --> 00:26:26,640
tile this all right this will remove the
628
00:26:26,640 --> 00:26:28,080
border radius
629
00:26:28,080 --> 00:26:30,240
um he wants it to be flat this will
630
00:26:30,240 --> 00:26:32,240
remove the elevation
631
00:26:32,240 --> 00:26:35,200
um we want to give it a class
632
00:26:35,200 --> 00:26:38,240
so on medium screen the pattern will be
633
00:26:38,240 --> 00:26:39,039
10
634
00:26:39,039 --> 00:26:41,600
on our own on smaller screens it will be
635
00:26:41,600 --> 00:26:42,559
five
636
00:26:42,559 --> 00:26:46,799
and what it takes to be in the center
637
00:26:46,799 --> 00:26:50,159
and of course the color of this uh
638
00:26:50,159 --> 00:26:53,520
footer card will be that surface column
639
00:26:53,520 --> 00:26:56,720
i'll add it to the beautify object
640
00:26:56,720 --> 00:26:58,480
so we're going to add
641
00:26:58,480 --> 00:27:00,320
h2 tag
642
00:27:00,320 --> 00:27:01,200
and
643
00:27:01,200 --> 00:27:03,200
the name of our applications for
644
00:27:03,200 --> 00:27:06,080
e-commerce
645
00:27:06,080 --> 00:27:09,919
uh let's add a class to this h2 tag
646
00:27:09,919 --> 00:27:13,279
so on medium screens
647
00:27:13,279 --> 00:27:16,320
i want the text to be h6
648
00:27:16,320 --> 00:27:18,720
and i want the font
649
00:27:18,720 --> 00:27:22,000
to be born
650
00:27:24,799 --> 00:27:28,080
i'm going to create some
651
00:27:28,799 --> 00:27:31,039
social media links
652
00:27:31,039 --> 00:27:32,159
so
653
00:27:32,159 --> 00:27:35,360
just create a data
654
00:27:35,360 --> 00:27:37,200
function down here
655
00:27:37,200 --> 00:27:39,440
should return an object
656
00:27:39,440 --> 00:27:42,080
and of course the sm links it's going to
657
00:27:42,080 --> 00:27:43,520
be an array
658
00:27:43,520 --> 00:27:48,760
of objects so it's going to be icon
659
00:27:48,880 --> 00:27:50,720
and the icon that we want to display for
660
00:27:50,720 --> 00:27:52,799
this um social media link so let's just
661
00:27:52,799 --> 00:27:54,399
facebook
662
00:27:54,399 --> 00:27:57,360
and then the actual link
663
00:27:57,360 --> 00:28:01,279
which is just gonna be a hashtag for now
664
00:28:01,279 --> 00:28:04,399
so we can save that and let's just copy
665
00:28:04,399 --> 00:28:06,640
this down a few times so facebook on
666
00:28:06,640 --> 00:28:10,320
twitter instagram and youtube
667
00:28:11,200 --> 00:28:13,679
twitter
668
00:28:14,480 --> 00:28:17,480
instagram
669
00:28:18,320 --> 00:28:20,399
youtube
670
00:28:20,399 --> 00:28:23,679
all right so up here we want to create
671
00:28:23,679 --> 00:28:26,399
the uh buttons to go to different social
672
00:28:26,399 --> 00:28:29,679
media pages so i'll just create a div
673
00:28:29,679 --> 00:28:32,480
with a class of text center and this
674
00:28:32,480 --> 00:28:34,799
will send to the buttons
675
00:28:34,799 --> 00:28:37,120
and we're going to create a v button
676
00:28:37,120 --> 00:28:40,080
with a v4 on it
677
00:28:40,080 --> 00:28:42,840
and this v4 is just going to loop over
678
00:28:42,840 --> 00:28:44,480
the
679
00:28:44,480 --> 00:28:46,559
objects inside the social media array
680
00:28:46,559 --> 00:28:48,240
that were created just a lot
681
00:28:48,240 --> 00:28:49,360
so
682
00:28:49,360 --> 00:28:51,200
just say button
683
00:28:51,200 --> 00:28:52,399
i
684
00:28:52,399 --> 00:28:54,240
in sm
685
00:28:54,240 --> 00:28:56,559
and we have to add a key
686
00:28:56,559 --> 00:29:00,480
i'm just going to give my key um
687
00:29:02,559 --> 00:29:04,799
media
688
00:29:04,799 --> 00:29:07,440
and index
689
00:29:07,440 --> 00:29:09,039
that works
690
00:29:09,039 --> 00:29:10,240
um
691
00:29:10,240 --> 00:29:11,840
call out a
692
00:29:11,840 --> 00:29:14,559
let's just use our surface color
693
00:29:14,559 --> 00:29:16,640
and class
694
00:29:16,640 --> 00:29:19,360
margin right by two
695
00:29:19,360 --> 00:29:22,640
um we want this to be a fab button
696
00:29:22,640 --> 00:29:25,039
and we don't want any elevation so we go
697
00:29:25,039 --> 00:29:26,960
with the press
698
00:29:26,960 --> 00:29:28,640
and inside the button we're just going
699
00:29:28,640 --> 00:29:31,679
to render the icon
700
00:29:31,679 --> 00:29:34,000
so we're going to use b
701
00:29:34,000 --> 00:29:35,679
the icon
702
00:29:35,679 --> 00:29:38,080
and save that
703
00:29:38,080 --> 00:29:42,320
now if we add this component to our
704
00:29:42,320 --> 00:29:45,039
page let's copy the path
705
00:29:45,039 --> 00:29:47,120
to our index page and see what it looks
706
00:29:47,120 --> 00:29:49,360
like
707
00:29:52,480 --> 00:29:57,279
so save that and back to the browser
708
00:29:58,240 --> 00:30:00,399
and there it is
709
00:30:00,399 --> 00:30:02,480
now of course as we add content this
710
00:30:02,480 --> 00:30:04,159
will be pushed on
711
00:30:04,159 --> 00:30:07,200
i don't want it to be fixed down here
712
00:30:07,200 --> 00:30:09,600
so i'll just leave it
713
00:30:09,600 --> 00:30:12,320
like this for now
714
00:30:12,320 --> 00:30:14,880
back to vs code
715
00:30:14,880 --> 00:30:17,600
let's just
716
00:30:18,480 --> 00:30:20,720
close these files
717
00:30:20,720 --> 00:30:22,399
don't need this anymore i don't need
718
00:30:22,399 --> 00:30:24,320
this for now
719
00:30:24,320 --> 00:30:26,000
only this one all the way so long all
720
00:30:26,000 --> 00:30:27,440
right
721
00:30:27,440 --> 00:30:30,399
so now that we added the photo
722
00:30:30,399 --> 00:30:34,320
let's um try getting the data from our
723
00:30:34,320 --> 00:30:38,720
content folder inside or index page
724
00:30:38,720 --> 00:30:40,559
so to do that
725
00:30:40,559 --> 00:30:45,039
um i'll be using the created hook
726
00:30:46,000 --> 00:30:47,919
inside is creating hook
727
00:30:47,919 --> 00:30:50,320
i'll just be calling the information
728
00:30:50,320 --> 00:30:52,240
from our content follow
729
00:30:52,240 --> 00:30:55,600
um to do let's actually need
730
00:30:55,600 --> 00:30:56,559
to
731
00:30:56,559 --> 00:30:58,799
create different properties that can be
732
00:30:58,799 --> 00:30:59,919
used
733
00:30:59,919 --> 00:31:04,000
in the template so let's go products
734
00:31:04,000 --> 00:31:06,240
this will be null initially
735
00:31:06,240 --> 00:31:08,000
and
736
00:31:08,000 --> 00:31:10,720
we want to sale
737
00:31:10,720 --> 00:31:12,399
items
738
00:31:12,399 --> 00:31:13,519
as well
739
00:31:13,519 --> 00:31:15,120
so up here we're just going to say this
740
00:31:15,120 --> 00:31:16,840
dot
741
00:31:16,840 --> 00:31:18,559
products
742
00:31:18,559 --> 00:31:21,600
is equal to this
743
00:31:21,760 --> 00:31:24,559
content
744
00:31:25,440 --> 00:31:26,559
and
745
00:31:26,559 --> 00:31:29,600
the follow that we'll be searching for
746
00:31:29,600 --> 00:31:32,480
the products in which is products
747
00:31:32,480 --> 00:31:35,279
so products
748
00:31:35,279 --> 00:31:37,760
and then we just want to get items
749
00:31:37,760 --> 00:31:40,080
where
750
00:31:40,880 --> 00:31:43,200
the on
751
00:31:43,200 --> 00:31:44,399
sale
752
00:31:44,399 --> 00:31:46,880
property is equal to true
753
00:31:46,880 --> 00:31:50,080
then we call fetch
754
00:31:50,960 --> 00:31:53,600
we want to do this
755
00:31:53,600 --> 00:31:56,159
oh no this is for the actual sale item
756
00:31:56,159 --> 00:31:58,960
so let's sell items and we want to do
757
00:31:58,960 --> 00:32:00,399
something similar for
758
00:32:00,399 --> 00:32:02,000
products
759
00:32:02,000 --> 00:32:02,960
so
760
00:32:02,960 --> 00:32:04,720
we're not going to use a where clause
761
00:32:04,720 --> 00:32:05,600
for
762
00:32:05,600 --> 00:32:06,960
our products we're just going to get all
763
00:32:06,960 --> 00:32:10,240
of them so first thing like this
764
00:32:10,240 --> 00:32:13,039
and once we hit save and hit box in
765
00:32:13,039 --> 00:32:15,600
browser
766
00:32:15,600 --> 00:32:19,919
we should be able to refresh and get the
767
00:32:19,919 --> 00:32:21,760
data so let's just
768
00:32:21,760 --> 00:32:24,240
go to our
769
00:32:24,240 --> 00:32:26,840
view extension
770
00:32:26,840 --> 00:32:30,960
here navigate to our index page
771
00:32:30,960 --> 00:32:35,039
oh and it's actually returning a promise
772
00:32:35,039 --> 00:32:37,360
so what we need to do is
773
00:32:37,360 --> 00:32:39,279
we need to head back to vs code and
774
00:32:39,279 --> 00:32:41,519
actually update our code
775
00:32:41,519 --> 00:32:44,559
to wait on this thing to get resolved
776
00:32:44,559 --> 00:32:47,440
before assigning it to the to the
777
00:32:47,440 --> 00:32:51,600
data variables so wait
778
00:32:51,919 --> 00:32:54,000
oh wait and of course in order to use a
779
00:32:54,000 --> 00:32:56,159
within any function you need to make it
780
00:32:56,159 --> 00:32:58,799
a synchronous
781
00:32:59,519 --> 00:33:01,279
so once you hit save there go back to
782
00:33:01,279 --> 00:33:02,720
chrome
783
00:33:02,720 --> 00:33:04,720
refresh
784
00:33:04,720 --> 00:33:07,760
we have our products
785
00:33:08,880 --> 00:33:12,240
and we have our sale items
786
00:33:12,240 --> 00:33:13,440
all right so now that we know that we're
787
00:33:13,440 --> 00:33:15,840
getting body data we can actually start
788
00:33:15,840 --> 00:33:18,080
rendering them on our
789
00:33:18,080 --> 00:33:19,679
page
790
00:33:19,679 --> 00:33:23,200
i'm going to create a carousel
791
00:33:23,519 --> 00:33:25,840
to display the sale items
792
00:33:25,840 --> 00:33:27,360
um
793
00:33:27,360 --> 00:33:30,000
let me just create that component no
794
00:33:30,000 --> 00:33:32,559
so it's
795
00:33:33,039 --> 00:33:35,840
let's call it home
796
00:33:35,840 --> 00:33:37,360
carousel
797
00:33:37,360 --> 00:33:38,150
you
798
00:33:38,150 --> 00:33:41,189
[Music]
799
00:33:41,440 --> 00:33:44,960
all right so we'll create our v
800
00:33:44,960 --> 00:33:47,679
carousel
801
00:33:49,200 --> 00:33:50,880
and we're just going to give this uh
802
00:33:50,880 --> 00:33:53,760
heights
803
00:33:53,760 --> 00:33:55,760
400
804
00:33:55,760 --> 00:33:57,600
view height
805
00:33:57,600 --> 00:33:59,120
and we're going to hide the limited
806
00:33:59,120 --> 00:34:01,679
background
807
00:34:02,480 --> 00:34:04,960
now in the v car cell
808
00:34:04,960 --> 00:34:06,960
it actually provides a slot for you to
809
00:34:06,960 --> 00:34:09,760
override the default next and previous
810
00:34:09,760 --> 00:34:11,119
button so we're going to override them
811
00:34:11,119 --> 00:34:12,399
as well
812
00:34:12,399 --> 00:34:15,359
just create a template
813
00:34:15,359 --> 00:34:17,679
and the named slots
814
00:34:17,679 --> 00:34:21,040
let's go previous
815
00:34:21,040 --> 00:34:23,679
and let's pass an object here we'll
816
00:34:23,679 --> 00:34:25,760
destructure the object that's passed
817
00:34:25,760 --> 00:34:28,320
to us from the previous slot
818
00:34:28,320 --> 00:34:29,760
and pass in
819
00:34:29,760 --> 00:34:31,199
attributes
820
00:34:31,199 --> 00:34:34,838
and on
821
00:34:34,960 --> 00:34:36,639
so we want
822
00:34:36,639 --> 00:34:40,719
to use a fab button for previous on next
823
00:34:40,719 --> 00:34:41,760
buttons
824
00:34:41,760 --> 00:34:42,719
so
825
00:34:42,719 --> 00:34:45,520
let's just create a vbtn
826
00:34:45,520 --> 00:34:48,520
fab
827
00:34:52,389 --> 00:34:55,448
[Music]
828
00:34:56,000 --> 00:34:58,160
let's make that depressed to take away
829
00:34:58,160 --> 00:34:59,839
the elevation
830
00:34:59,839 --> 00:35:02,480
and we will need to bind
831
00:35:02,480 --> 00:35:05,680
the attributes as fast back
832
00:35:05,680 --> 00:35:08,000
and the v on
833
00:35:08,000 --> 00:35:10,640
should be this on
834
00:35:10,640 --> 00:35:13,119
that's passed to us
835
00:35:13,119 --> 00:35:14,320
um
836
00:35:14,320 --> 00:35:17,359
for the icon for this button
837
00:35:17,359 --> 00:35:20,079
we're going to use the
838
00:35:20,079 --> 00:35:21,599
our left
839
00:35:21,599 --> 00:35:24,640
so that's mdi
840
00:35:24,960 --> 00:35:28,240
our row left button
841
00:35:28,240 --> 00:35:31,280
and let's just change the size
842
00:35:31,280 --> 00:35:33,280
20
843
00:35:33,280 --> 00:35:34,640
and we're going to do something similar
844
00:35:34,640 --> 00:35:36,480
for
845
00:35:36,480 --> 00:35:38,560
for the next one
846
00:35:38,560 --> 00:35:39,440
uh
847
00:35:39,440 --> 00:35:41,200
let's do
848
00:35:41,200 --> 00:35:43,040
next
849
00:35:43,040 --> 00:35:46,400
and it should be right
850
00:35:47,200 --> 00:35:49,040
all right good
851
00:35:49,040 --> 00:35:50,960
so
852
00:35:50,960 --> 00:35:53,359
now that we have
853
00:35:53,359 --> 00:35:54,320
the
854
00:35:54,320 --> 00:35:56,160
previous and next button overridden
855
00:35:56,160 --> 00:35:58,800
let's add the carousel items
856
00:35:58,800 --> 00:36:00,320
so we
857
00:36:00,320 --> 00:36:01,760
can sell
858
00:36:01,760 --> 00:36:03,920
item
859
00:36:03,920 --> 00:36:06,560
and we're going to loop over the sale
860
00:36:06,560 --> 00:36:08,640
items in this
861
00:36:08,640 --> 00:36:11,520
recursion item component
862
00:36:11,520 --> 00:36:13,520
and just display them
863
00:36:13,520 --> 00:36:15,440
as a carousel item
864
00:36:15,440 --> 00:36:18,400
so we need v4
865
00:36:18,480 --> 00:36:20,480
and for each product
866
00:36:20,480 --> 00:36:21,920
on index
867
00:36:21,920 --> 00:36:23,280
in
868
00:36:23,280 --> 00:36:24,560
sale
869
00:36:24,560 --> 00:36:26,160
items
870
00:36:26,160 --> 00:36:28,160
oh
871
00:36:28,160 --> 00:36:31,040
it should be an underscore
872
00:36:31,040 --> 00:36:32,400
and we're getting this squiggly line
873
00:36:32,400 --> 00:36:36,640
because we need to pass in a key or
874
00:36:36,640 --> 00:36:37,839
create a key
875
00:36:37,839 --> 00:36:41,839
and the key will be sale item
876
00:36:42,480 --> 00:36:43,440
i
877
00:36:43,440 --> 00:36:44,800
index
878
00:36:44,800 --> 00:36:46,720
yup that works
879
00:36:46,720 --> 00:36:48,720
and then we can actually close this so
880
00:36:48,720 --> 00:36:52,160
for each cell item that's passed in
881
00:36:52,160 --> 00:36:54,960
it will render a carousel item
882
00:36:54,960 --> 00:36:56,880
in this carousel
883
00:36:56,880 --> 00:37:01,599
so let's accept the sale items prop
884
00:37:01,599 --> 00:37:04,560
i hope it should be uncomfortable
885
00:37:04,560 --> 00:37:06,560
and the prop type will be
886
00:37:06,560 --> 00:37:09,800
an array
887
00:37:09,839 --> 00:37:11,920
now what do we want to render here we
888
00:37:11,920 --> 00:37:13,920
want to render an image so we're going
889
00:37:13,920 --> 00:37:15,760
to use the image
890
00:37:15,760 --> 00:37:17,920
the height is going to be 100 view
891
00:37:17,920 --> 00:37:19,520
height
892
00:37:19,520 --> 00:37:23,599
and the source is going to be
893
00:37:23,599 --> 00:37:26,880
the image on this product
894
00:37:26,880 --> 00:37:30,400
so let's pee that image
895
00:37:33,280 --> 00:37:36,000
and inside this image we will have a
896
00:37:36,000 --> 00:37:38,800
container
897
00:37:38,960 --> 00:37:42,240
put a plaster fill height
898
00:37:44,800 --> 00:37:48,320
and we're going to render a row
899
00:37:49,119 --> 00:37:50,960
with
900
00:37:50,960 --> 00:37:53,440
the dense crop and we're going to align
901
00:37:53,440 --> 00:37:56,000
its center
902
00:37:58,000 --> 00:38:01,520
now we only want one column
903
00:38:01,520 --> 00:38:03,440
so we're going to render the
904
00:38:03,440 --> 00:38:05,920
and for
905
00:38:05,920 --> 00:38:07,440
medium and up
906
00:38:07,440 --> 00:38:08,800
it's going to be
907
00:38:08,800 --> 00:38:10,000
uh
908
00:38:10,000 --> 00:38:11,839
seven it's going to take up seven of the
909
00:38:11,839 --> 00:38:13,680
12
910
00:38:13,680 --> 00:38:16,000
slots
911
00:38:16,000 --> 00:38:18,000
inside this column i'm going to have a
912
00:38:18,000 --> 00:38:20,160
div
913
00:38:20,160 --> 00:38:21,599
and
914
00:38:21,599 --> 00:38:25,760
this div is going to have our style
915
00:38:25,760 --> 00:38:27,359
to change the background color so we're
916
00:38:27,359 --> 00:38:28,880
going to put a white
917
00:38:28,880 --> 00:38:33,079
uh background color behind vertex
918
00:38:42,160 --> 00:38:46,079
i give it an opacity of it
919
00:38:46,079 --> 00:38:49,119
and we will also want to add a class
920
00:38:49,119 --> 00:38:50,480
to this div
921
00:38:50,480 --> 00:38:51,520
um
922
00:38:51,520 --> 00:38:53,359
we're going to add a padding on medium
923
00:38:53,359 --> 00:38:55,119
screen down up of 10
924
00:38:55,119 --> 00:38:57,920
and on smaller screens 5
925
00:38:57,920 --> 00:39:01,680
it's going to have rounded corners
926
00:39:01,680 --> 00:39:04,320
and the text is going to be
927
00:39:04,320 --> 00:39:05,359
block
928
00:39:05,359 --> 00:39:07,440
regardless of the theme
929
00:39:07,440 --> 00:39:12,040
we're also going to send to the text
930
00:39:14,800 --> 00:39:16,720
and
931
00:39:16,720 --> 00:39:19,520
we want the text to be on the left
932
00:39:19,520 --> 00:39:22,720
on larger screens
933
00:39:24,000 --> 00:39:26,800
let's save that
934
00:39:26,960 --> 00:39:28,320
of course we're not going to see
935
00:39:28,320 --> 00:39:30,880
anything yet on our index page because
936
00:39:30,880 --> 00:39:34,400
we have imported this uh component
937
00:39:34,400 --> 00:39:35,839
so let's just add the product
938
00:39:35,839 --> 00:39:37,599
information
939
00:39:37,599 --> 00:39:40,000
so i want the h2 tag
940
00:39:40,000 --> 00:39:43,520
with the class of texts medium
941
00:39:43,520 --> 00:39:45,040
h3
942
00:39:45,040 --> 00:39:46,880
and on smaller screens
943
00:39:46,880 --> 00:39:49,599
page five
944
00:39:49,920 --> 00:39:51,359
and this is going to be the name of our
945
00:39:51,359 --> 00:39:53,760
product
946
00:39:55,359 --> 00:39:57,359
then we want to show
947
00:39:57,359 --> 00:39:58,480
the price
948
00:39:58,480 --> 00:40:00,079
of the product
949
00:40:00,079 --> 00:40:01,440
so
950
00:40:01,440 --> 00:40:03,520
that's going to be
951
00:40:03,520 --> 00:40:04,720
p
952
00:40:04,720 --> 00:40:07,040
price
953
00:40:08,240 --> 00:40:10,720
uh let's give this a class on
954
00:40:10,720 --> 00:40:13,760
larger screens we want it to be
955
00:40:13,760 --> 00:40:16,400
h5
956
00:40:17,359 --> 00:40:20,240
and on
957
00:40:20,240 --> 00:40:22,400
smaller screens we wanted to have
958
00:40:22,400 --> 00:40:24,640
subtitle one
959
00:40:24,640 --> 00:40:26,000
as the size
960
00:40:26,000 --> 00:40:27,920
i want this to be our primary color as
961
00:40:27,920 --> 00:40:30,880
well so use primary text and
962
00:40:30,880 --> 00:40:32,640
so margin from the top
963
00:40:32,640 --> 00:40:35,599
margin top five
964
00:40:37,440 --> 00:40:39,440
next we want to add the product
965
00:40:39,440 --> 00:40:40,640
description
966
00:40:40,640 --> 00:40:41,839
so
967
00:40:41,839 --> 00:40:44,640
let's add another p tag
968
00:40:44,640 --> 00:40:48,240
p dot description
969
00:40:48,240 --> 00:40:51,200
understanding on this
970
00:40:51,200 --> 00:40:54,000
oh plus
971
00:40:54,000 --> 00:40:55,920
x
972
00:40:55,920 --> 00:40:58,319
medium
973
00:40:58,319 --> 00:40:59,760
22
974
00:40:59,760 --> 00:41:03,599
and a margin bottom of seven
975
00:41:04,319 --> 00:41:06,720
all right lastly to this um we want to
976
00:41:06,720 --> 00:41:09,280
add our button
977
00:41:09,280 --> 00:41:11,920
and this button will be the press
978
00:41:11,920 --> 00:41:14,880
to remove the elevation
979
00:41:14,880 --> 00:41:15,839
uh
980
00:41:15,839 --> 00:41:20,240
we'll have a color of primary
981
00:41:20,240 --> 00:41:23,359
class of test capitalization
982
00:41:23,359 --> 00:41:24,800
capitalize
983
00:41:24,800 --> 00:41:26,640
and a minimum height
984
00:41:26,640 --> 00:41:29,200
of 40.
985
00:41:29,200 --> 00:41:31,359
and what will this button say this but
986
00:41:31,359 --> 00:41:33,440
we'll just say check
987
00:41:33,440 --> 00:41:36,400
it out
988
00:41:36,560 --> 00:41:38,079
all right so let's save this and add it
989
00:41:38,079 --> 00:41:42,000
to our index page so boom
990
00:41:42,000 --> 00:41:43,680
boom
991
00:41:43,680 --> 00:41:48,040
so let's add it below or now
992
00:41:51,040 --> 00:41:54,480
and let's pass in the
993
00:41:54,480 --> 00:41:56,400
sales
994
00:41:56,400 --> 00:41:59,280
sale items
995
00:41:59,440 --> 00:42:03,359
so buy and sell items to
996
00:42:03,359 --> 00:42:06,560
sale items here
997
00:42:07,440 --> 00:42:11,040
let's close this and see if it works
998
00:42:15,119 --> 00:42:17,839
and it does
999
00:42:19,599 --> 00:42:20,720
so
1000
00:42:20,720 --> 00:42:22,880
each cell item
1001
00:42:22,880 --> 00:42:24,240
is here
1002
00:42:24,240 --> 00:42:26,640
it's good
1003
00:42:26,640 --> 00:42:29,440
check it out button is here
1004
00:42:29,440 --> 00:42:31,839
and if you check the
1005
00:42:31,839 --> 00:42:33,920
the content file
1006
00:42:33,920 --> 00:42:35,359
in vs code
1007
00:42:35,359 --> 00:42:36,560
you'll see
1008
00:42:36,560 --> 00:42:37,760
that
1009
00:42:37,760 --> 00:42:40,240
only three products have
1010
00:42:40,240 --> 00:42:41,680
the on sale
1011
00:42:41,680 --> 00:42:44,560
parameter set to show this one
1012
00:42:44,560 --> 00:42:45,760
this one
1013
00:42:45,760 --> 00:42:49,040
and the watch
1014
00:42:50,240 --> 00:42:52,240
all right so now that we have our sale
1015
00:42:52,240 --> 00:42:53,520
items
1016
00:42:53,520 --> 00:42:54,880
being displayed
1017
00:42:54,880 --> 00:42:57,119
we can actually move on to
1018
00:42:57,119 --> 00:42:59,280
in the
1019
00:42:59,280 --> 00:43:01,839
slider that's on the home page um this
1020
00:43:01,839 --> 00:43:04,400
will display all our products
1021
00:43:04,400 --> 00:43:07,440
so let's just close this one
1022
00:43:07,440 --> 00:43:10,720
add some space below it
1023
00:43:10,720 --> 00:43:14,000
and that's all the container
1024
00:43:14,000 --> 00:43:15,920
uh
1025
00:43:15,920 --> 00:43:18,000
this container
1026
00:43:18,000 --> 00:43:21,119
will just uh have like a label
1027
00:43:21,119 --> 00:43:25,240
so in here you can check these out
1028
00:43:26,079 --> 00:43:28,079
uh let's give it a class let's give it a
1029
00:43:28,079 --> 00:43:29,680
class
1030
00:43:29,680 --> 00:43:30,880
of um
1031
00:43:30,880 --> 00:43:33,440
on medium screens i want the text to be
1032
00:43:33,440 --> 00:43:35,119
h4
1033
00:43:35,119 --> 00:43:37,040
and on smaller screens let's just leave
1034
00:43:37,040 --> 00:43:40,280
it at a6
1035
00:43:41,040 --> 00:43:43,839
add some space below this
1036
00:43:43,839 --> 00:43:47,119
and we want to create a component called
1037
00:43:47,119 --> 00:43:49,839
product sliders
1038
00:43:49,839 --> 00:43:54,400
so let me just create that no product
1039
00:43:54,400 --> 00:43:56,960
slider
1040
00:43:58,560 --> 00:44:01,359
and in this component we're just gonna
1041
00:44:01,359 --> 00:44:04,800
create um
1042
00:44:05,119 --> 00:44:06,839
we're just gonna use a v slide group
1043
00:44:06,839 --> 00:44:10,400
component to display all our products
1044
00:44:10,400 --> 00:44:11,760
so v
1045
00:44:11,760 --> 00:44:15,119
slide group
1046
00:44:15,920 --> 00:44:19,520
and the v slide group components accept
1047
00:44:19,520 --> 00:44:24,400
multiple v slide items
1048
00:44:24,400 --> 00:44:27,920
so we slide it
1049
00:44:28,079 --> 00:44:29,680
now we're going to
1050
00:44:29,680 --> 00:44:32,400
use a v4 on the v-slot item to iterate
1051
00:44:32,400 --> 00:44:33,839
over the products that will be passing
1052
00:44:33,839 --> 00:44:37,480
in so v4
1053
00:44:44,000 --> 00:44:46,560
and of course we have to give it a key
1054
00:44:46,560 --> 00:44:48,560
each item needs a key
1055
00:44:48,560 --> 00:44:53,160
we're just going to say hearts product
1056
00:44:54,560 --> 00:44:56,800
i
1057
00:44:56,800 --> 00:44:59,520
let's leave it up
1058
00:44:59,520 --> 00:45:02,839
uh of course we need to pass the prop
1059
00:45:02,839 --> 00:45:04,960
in so we're going to pass in this
1060
00:45:04,960 --> 00:45:07,440
products
1061
00:45:08,160 --> 00:45:11,359
and it's going to be an array
1062
00:45:11,359 --> 00:45:14,319
so here we need a card that will display
1063
00:45:14,319 --> 00:45:17,359
all our products
1064
00:45:17,680 --> 00:45:18,480
so
1065
00:45:18,480 --> 00:45:19,760
let's go
1066
00:45:19,760 --> 00:45:20,640
um
1067
00:45:20,640 --> 00:45:23,359
these cards will be links
1068
00:45:23,359 --> 00:45:26,400
um the color
1069
00:45:26,400 --> 00:45:28,400
surface
1070
00:45:28,400 --> 00:45:30,480
uh the width and let's see if there was
1071
00:45:30,480 --> 00:45:33,040
a 300
1072
00:45:33,040 --> 00:45:35,760
class um we're going to override the
1073
00:45:35,760 --> 00:45:37,280
elevation
1074
00:45:37,280 --> 00:45:40,800
that comes with the cards from beautify
1075
00:45:40,800 --> 00:45:42,560
and add our own
1076
00:45:42,560 --> 00:45:45,680
let's give it a marginal tool
1077
00:45:45,680 --> 00:45:48,960
margin bottom of five and a margin right
1078
00:45:48,960 --> 00:45:51,760
of five
1079
00:45:52,400 --> 00:45:54,560
now inside each card we will have
1080
00:45:54,560 --> 00:45:57,200
an image at the top
1081
00:45:57,200 --> 00:46:01,280
image will have a height of 300 and the
1082
00:46:01,280 --> 00:46:02,800
source
1083
00:46:02,800 --> 00:46:05,280
will be
1084
00:46:05,280 --> 00:46:08,240
the um
1085
00:46:08,880 --> 00:46:13,040
current products image url
1086
00:46:13,040 --> 00:46:16,560
current products image url yeah
1087
00:46:16,560 --> 00:46:19,200
so we can close this
1088
00:46:19,200 --> 00:46:20,319
uh
1089
00:46:20,319 --> 00:46:22,319
it's always good practice to have a
1090
00:46:22,319 --> 00:46:24,160
placeholder
1091
00:46:24,160 --> 00:46:27,520
while your image is being loaded um
1092
00:46:27,520 --> 00:46:29,839
beautify actually provides
1093
00:46:29,839 --> 00:46:32,800
this slot for images so you can just
1094
00:46:32,800 --> 00:46:34,800
create a template
1095
00:46:34,800 --> 00:46:38,960
and create placeholder slot
1096
00:46:39,280 --> 00:46:40,079
and
1097
00:46:40,079 --> 00:46:41,760
for placeholder i'm just gonna copy and
1098
00:46:41,760 --> 00:46:44,400
paste this uh
1099
00:46:44,400 --> 00:46:46,960
circular progress
1100
00:46:46,960 --> 00:46:47,760
um
1101
00:46:47,760 --> 00:46:50,160
bar in so it has a width of two
1102
00:46:50,160 --> 00:46:52,880
pixels a size of a hundred
1103
00:46:52,880 --> 00:46:55,119
uh the color of the primary and
1104
00:46:55,119 --> 00:46:58,000
indeterminate as a state so it will be
1105
00:46:58,000 --> 00:47:01,359
spinning spinning spinning
1106
00:47:02,000 --> 00:47:04,880
i'll save that
1107
00:47:05,040 --> 00:47:06,000
now
1108
00:47:06,000 --> 00:47:07,599
for
1109
00:47:07,599 --> 00:47:08,839
or car
1110
00:47:08,839 --> 00:47:14,319
title below the image we want to add the
1111
00:47:14,319 --> 00:47:16,640
name of the product
1112
00:47:16,640 --> 00:47:19,359
so we're gonna add the
1113
00:47:19,359 --> 00:47:20,720
title
1114
00:47:20,720 --> 00:47:24,160
of text title
1115
00:47:24,160 --> 00:47:27,680
i'm gonna pee down in
1116
00:47:27,680 --> 00:47:31,480
let's give you some styling
1117
00:47:40,800 --> 00:47:43,920
we want the price as well
1118
00:47:43,920 --> 00:47:46,559
so let's use our subtitle component for
1119
00:47:46,559 --> 00:47:49,559
that
1120
00:47:52,880 --> 00:47:57,040
uh let's make the price
1121
00:47:57,760 --> 00:48:01,200
text color or primary color
1122
00:48:01,200 --> 00:48:03,520
and having
1123
00:48:03,520 --> 00:48:07,160
bottom of three
1124
00:48:07,200 --> 00:48:09,280
and then let's add
1125
00:48:09,280 --> 00:48:10,800
the tags
1126
00:48:10,800 --> 00:48:14,480
that are associated with the products of
1127
00:48:14,480 --> 00:48:17,280
our text
1128
00:48:18,319 --> 00:48:22,160
we're gonna use chips to display
1129
00:48:22,160 --> 00:48:24,000
the different um
1130
00:48:24,000 --> 00:48:25,520
tags
1131
00:48:25,520 --> 00:48:28,000
so we're gonna iterate over the
1132
00:48:28,000 --> 00:48:30,240
different tags as the
1133
00:48:30,240 --> 00:48:32,559
tags i think they're they're in an array
1134
00:48:32,559 --> 00:48:35,200
yep
1135
00:48:35,200 --> 00:48:37,040
so let's iterate over them
1136
00:48:37,040 --> 00:48:39,440
v4
1137
00:48:46,160 --> 00:48:48,800
so we're going to say
1138
00:48:48,800 --> 00:48:49,520
t
1139
00:48:49,520 --> 00:48:50,880
i
1140
00:48:50,880 --> 00:48:51,920
n p
1141
00:48:51,920 --> 00:48:54,240
tags
1142
00:48:54,240 --> 00:48:57,280
of course there's a key
1143
00:48:57,280 --> 00:48:58,880
okay
1144
00:48:58,880 --> 00:49:01,760
i'm gonna use product
1145
00:49:01,760 --> 00:49:04,000
product id
1146
00:49:04,000 --> 00:49:06,240
followed by i
1147
00:49:06,240 --> 00:49:08,319
very unique
1148
00:49:08,319 --> 00:49:10,880
and let's just put t there
1149
00:49:10,880 --> 00:49:14,880
um we want this to be small extra small
1150
00:49:14,880 --> 00:49:16,960
we want them to have the label style i
1151
00:49:16,960 --> 00:49:19,440
want them to be outlined
1152
00:49:19,440 --> 00:49:22,240
uh let's just give them some
1153
00:49:22,240 --> 00:49:24,480
space
1154
00:49:24,480 --> 00:49:25,200
so
1155
00:49:25,200 --> 00:49:28,079
much right one
1156
00:49:28,319 --> 00:49:30,640
yeah that should be it
1157
00:49:30,640 --> 00:49:32,400
so now we can actually add this to our
1158
00:49:32,400 --> 00:49:35,760
homepage so let's copy the path
1159
00:49:35,760 --> 00:49:39,520
and add it right here
1160
00:49:41,440 --> 00:49:43,280
well of course we need to pass in the
1161
00:49:43,280 --> 00:49:45,119
prop
1162
00:49:45,119 --> 00:49:48,000
so we need the products
1163
00:49:48,000 --> 00:49:49,760
and it's going to be
1164
00:49:49,760 --> 00:49:53,040
the products i'm doing here
1165
00:49:55,760 --> 00:49:58,319
let's close this and save and see if it
1166
00:49:58,319 --> 00:50:00,960
works
1167
00:50:05,920 --> 00:50:08,640
and it does
1168
00:50:08,640 --> 00:50:11,440
so we have all our product cards down
1169
00:50:11,440 --> 00:50:13,839
here
1170
00:50:17,200 --> 00:50:19,440
good
1171
00:50:20,559 --> 00:50:22,720
all right so the next section that we
1172
00:50:22,720 --> 00:50:25,359
need to work on is the new data section
1173
00:50:25,359 --> 00:50:27,839
and of course that will be below
1174
00:50:27,839 --> 00:50:30,160
the slider here
1175
00:50:30,160 --> 00:50:31,839
so let's jump back to vs code and work
1176
00:50:31,839 --> 00:50:34,160
on that
1177
00:50:38,079 --> 00:50:41,839
so let's just create a new component
1178
00:50:42,079 --> 00:50:44,720
use little
1179
00:50:46,720 --> 00:50:48,160
yeah knows that there's just going to be
1180
00:50:48,160 --> 00:50:49,520
a card
1181
00:50:49,520 --> 00:50:53,400
um it'll be rounded
1182
00:50:54,240 --> 00:50:57,839
and let's just add some styling
1183
00:51:03,520 --> 00:51:07,079
and color
1184
00:51:10,319 --> 00:51:12,319
now in our newsletter card
1185
00:51:12,319 --> 00:51:13,440
we
1186
00:51:13,440 --> 00:51:14,800
just gonna have
1187
00:51:14,800 --> 00:51:19,119
heading of news that's all
1188
00:51:20,240 --> 00:51:23,119
and some ticks
1189
00:51:23,119 --> 00:51:24,559
subscribe
1190
00:51:24,559 --> 00:51:27,359
and let's see
1191
00:51:27,680 --> 00:51:30,240
this comes
1192
00:51:31,440 --> 00:51:34,440
this
1193
00:51:38,400 --> 00:51:41,599
i just add some style to our text
1194
00:51:41,599 --> 00:51:44,559
so this one
1195
00:51:46,240 --> 00:51:50,520
takes medium 283
1196
00:51:50,720 --> 00:51:53,599
and for this one
1197
00:51:53,599 --> 00:51:57,520
text medium is going to be h6
1198
00:51:57,520 --> 00:52:01,480
and some margin top
1199
00:52:05,200 --> 00:52:07,280
all right so we want a
1200
00:52:07,280 --> 00:52:09,280
text field so the user can enter their
1201
00:52:09,280 --> 00:52:10,960
email address
1202
00:52:10,960 --> 00:52:13,599
and a button to
1203
00:52:13,599 --> 00:52:15,760
actually subscribe if we are to hold
1204
00:52:15,760 --> 00:52:17,680
this up to a bucket
1205
00:52:17,680 --> 00:52:19,839
in the future so let's just use a
1206
00:52:19,839 --> 00:52:20,880
v-sheet
1207
00:52:20,880 --> 00:52:22,319
to do that
1208
00:52:22,319 --> 00:52:27,440
um set the color to be transparent
1209
00:52:28,559 --> 00:52:30,559
class
1210
00:52:30,559 --> 00:52:33,520
comics auto to center sheet
1211
00:52:33,520 --> 00:52:35,599
and the max width
1212
00:52:35,599 --> 00:52:36,720
max
1213
00:52:36,720 --> 00:52:38,319
weight
1214
00:52:38,319 --> 00:52:41,200
of 400.
1215
00:52:41,359 --> 00:52:45,359
alongside this we can add our text field
1216
00:52:55,040 --> 00:52:58,800
and let's just model this to
1217
00:52:58,800 --> 00:53:01,040
some data so
1218
00:53:01,040 --> 00:53:03,839
email is no
1219
00:53:06,800 --> 00:53:09,200
email
1220
00:53:10,559 --> 00:53:13,359
below this text field
1221
00:53:13,359 --> 00:53:15,520
we need a
1222
00:53:15,520 --> 00:53:17,839
button
1223
00:53:19,839 --> 00:53:22,960
so this button will be outlined as well
1224
00:53:22,960 --> 00:53:26,720
another minimum height of 50.
1225
00:53:26,720 --> 00:53:28,559
will be a black one
1226
00:53:28,559 --> 00:53:31,920
and it'll just say subscribe
1227
00:53:35,040 --> 00:53:37,839
now we want to call a function whenever
1228
00:53:37,839 --> 00:53:40,880
the user click on this um
1229
00:53:40,880 --> 00:53:42,640
subscribe button let's just call it
1230
00:53:42,640 --> 00:53:43,839
submit
1231
00:53:43,839 --> 00:53:47,520
and create the method down here
1232
00:53:53,119 --> 00:53:55,200
now in this
1233
00:53:55,200 --> 00:53:58,079
i'm just going to add a sweet alert
1234
00:53:58,079 --> 00:53:59,440
model
1235
00:53:59,440 --> 00:54:01,680
so you can call this dot
1236
00:54:01,680 --> 00:54:04,000
song
1237
00:54:04,000 --> 00:54:06,960
subtitle
1238
00:54:08,000 --> 00:54:08,839
thank
1239
00:54:08,839 --> 00:54:10,720
you
1240
00:54:10,720 --> 00:54:14,359
for subscribing
1241
00:54:17,040 --> 00:54:20,240
it's going to be success
1242
00:54:22,839 --> 00:54:24,400
uh
1243
00:54:24,400 --> 00:54:26,559
let me add some
1244
00:54:26,559 --> 00:54:29,440
configuration to this so we allow
1245
00:54:29,440 --> 00:54:30,880
outside click
1246
00:54:30,880 --> 00:54:32,720
i'm gonna set that to file so that user
1247
00:54:32,720 --> 00:54:35,440
can click outside to close the model
1248
00:54:35,440 --> 00:54:36,720
um
1249
00:54:36,720 --> 00:54:39,680
allow skp to false so they can't use
1250
00:54:39,680 --> 00:54:42,000
escape to close the model i'm gonna set
1251
00:54:42,000 --> 00:54:44,559
a timer of 400
1252
00:54:44,559 --> 00:54:47,119
so the model will show for four
1253
00:54:47,119 --> 00:54:49,760
seconds
1254
00:54:49,760 --> 00:54:50,640
um
1255
00:54:50,640 --> 00:54:52,880
and we're going to show the
1256
00:54:52,880 --> 00:54:55,359
timer progress bar so let's set that to
1257
00:54:55,359 --> 00:54:57,599
true
1258
00:54:57,920 --> 00:55:00,480
and our text um
1259
00:55:00,480 --> 00:55:02,960
let's just add this text here
1260
00:55:02,960 --> 00:55:04,720
so you'll be notified when we have a
1261
00:55:04,720 --> 00:55:08,240
deal or items on sale
1262
00:55:08,240 --> 00:55:12,319
and let's remove the confirmation button
1263
00:55:12,319 --> 00:55:14,079
as well
1264
00:55:14,079 --> 00:55:15,680
so we can save this
1265
00:55:15,680 --> 00:55:17,359
and um
1266
00:55:17,359 --> 00:55:20,400
that should be it for our all components
1267
00:55:20,400 --> 00:55:22,960
let's put it on our
1268
00:55:22,960 --> 00:55:26,960
home page just copy the relative path
1269
00:55:29,440 --> 00:55:31,920
put some space
1270
00:55:31,920 --> 00:55:35,839
between it and the slider
1271
00:55:39,680 --> 00:55:41,760
hit save
1272
00:55:41,760 --> 00:55:44,319
and let's go to chrome and see what's
1273
00:55:44,319 --> 00:55:46,079
happening
1274
00:55:46,079 --> 00:55:50,799
so you scroll down and here it is
1275
00:55:50,799 --> 00:55:53,440
we have one newsletter ariel and if you
1276
00:55:53,440 --> 00:55:55,119
click subscribe
1277
00:55:55,119 --> 00:55:57,440
you get this pop off
1278
00:55:57,440 --> 00:55:59,760
nice
1279
00:56:00,319 --> 00:56:04,079
alright so now that we have
1280
00:56:04,079 --> 00:56:05,520
the
1281
00:56:05,520 --> 00:56:07,520
newsletter components let's create this
1282
00:56:07,520 --> 00:56:10,000
scroll to top button
1283
00:56:10,000 --> 00:56:12,000
that should be down here
1284
00:56:12,000 --> 00:56:16,440
uh let's go back to vs code
1285
00:56:16,720 --> 00:56:19,680
and close this newsletter
1286
00:56:19,680 --> 00:56:22,799
and let's just create a new component
1287
00:56:22,799 --> 00:56:24,880
scroll
1288
00:56:24,880 --> 00:56:27,880
top
1289
00:56:32,559 --> 00:56:35,440
and this component is
1290
00:56:35,440 --> 00:56:36,880
somewhat simple
1291
00:56:36,880 --> 00:56:39,440
um it's just a button
1292
00:56:39,440 --> 00:56:42,400
um so let's probably be
1293
00:56:42,400 --> 00:56:44,000
cn
1294
00:56:44,000 --> 00:56:46,000
and we're gonna give it uh
1295
00:56:46,000 --> 00:56:48,720
the fix prop so that it stays
1296
00:56:48,720 --> 00:56:50,400
in the bottom
1297
00:56:50,400 --> 00:56:52,000
right hand corner of our screen at all
1298
00:56:52,000 --> 00:56:53,119
times
1299
00:56:53,119 --> 00:56:55,200
over right
1300
00:56:55,200 --> 00:56:57,760
bottom
1301
00:56:57,760 --> 00:56:59,359
all right now let's
1302
00:56:59,359 --> 00:57:02,079
make it a fab
1303
00:57:02,079 --> 00:57:06,000
uh give it a call of primary
1304
00:57:06,720 --> 00:57:07,920
um
1305
00:57:07,920 --> 00:57:09,599
we want to
1306
00:57:09,599 --> 00:57:12,160
also
1307
00:57:12,160 --> 00:57:14,160
some action whenever the page is
1308
00:57:14,160 --> 00:57:16,160
scrolled and
1309
00:57:16,160 --> 00:57:18,079
we're going to put the v scroll
1310
00:57:18,079 --> 00:57:21,280
directive from beautify on this one
1311
00:57:21,280 --> 00:57:23,920
so let's go v school
1312
00:57:23,920 --> 00:57:25,599
and the name of the function that we
1313
00:57:25,599 --> 00:57:27,920
want to call whenever the window is
1314
00:57:27,920 --> 00:57:30,240
scrolled is check scroll
1315
00:57:30,240 --> 00:57:32,480
we also want to
1316
00:57:32,480 --> 00:57:34,799
show this button based on how much of
1317
00:57:34,799 --> 00:57:36,799
our screen has been scrolled
1318
00:57:36,799 --> 00:57:40,079
so let's call this property show fab we
1319
00:57:40,079 --> 00:57:41,839
need to create this property
1320
00:57:41,839 --> 00:57:43,440
down here
1321
00:57:43,440 --> 00:57:44,480
but let's
1322
00:57:44,480 --> 00:57:47,280
let's close this off first
1323
00:57:47,280 --> 00:57:51,040
unput on an icon inside this
1324
00:57:51,040 --> 00:57:53,760
so we're gonna use the chevron
1325
00:57:53,760 --> 00:57:56,240
icon
1326
00:57:57,200 --> 00:57:59,680
save that
1327
00:58:03,119 --> 00:58:05,760
and set this to files initially
1328
00:58:05,760 --> 00:58:08,240
alright so for the method
1329
00:58:08,240 --> 00:58:12,000
um we should create this method
1330
00:58:15,440 --> 00:58:16,240
so
1331
00:58:16,240 --> 00:58:18,400
in this check scroll method we're just
1332
00:58:18,400 --> 00:58:20,880
gonna get the um
1333
00:58:20,880 --> 00:58:22,880
the window scroll y
1334
00:58:22,880 --> 00:58:24,319
value
1335
00:58:24,319 --> 00:58:25,359
and
1336
00:58:25,359 --> 00:58:28,319
perform some logic based on that so
1337
00:58:28,319 --> 00:58:32,000
let's call this h so we go to window
1338
00:58:32,000 --> 00:58:34,640
scroll y
1339
00:58:34,640 --> 00:58:36,480
now we want to check if
1340
00:58:36,480 --> 00:58:40,079
h is greater than 300
1341
00:58:40,079 --> 00:58:42,000
and if it is
1342
00:58:42,000 --> 00:58:45,280
we'll show the one
1343
00:58:46,720 --> 00:58:49,720
else
1344
00:58:52,559 --> 00:58:55,440
we will hide one
1345
00:59:00,720 --> 00:59:02,400
now this will actually show and hide the
1346
00:59:02,400 --> 00:59:03,599
button
1347
00:59:03,599 --> 00:59:06,559
once we scroll the window
1348
00:59:06,559 --> 00:59:08,240
what we want to do once the button is
1349
00:59:08,240 --> 00:59:10,240
visible is we want to be able to click
1350
00:59:10,240 --> 00:59:12,079
on it
1351
00:59:12,079 --> 00:59:14,160
and then we should be able to go back to
1352
00:59:14,160 --> 00:59:16,400
the top of the screen so we are the ad
1353
00:59:16,400 --> 00:59:17,599
click
1354
00:59:17,599 --> 00:59:20,559
and go up method
1355
00:59:21,440 --> 00:59:23,760
go up
1356
00:59:24,079 --> 00:59:25,920
and what this will do
1357
00:59:25,920 --> 00:59:27,920
it will call the
1358
00:59:27,920 --> 00:59:31,760
go to method from or beautify object
1359
00:59:31,760 --> 00:59:32,640
so
1360
00:59:32,640 --> 00:59:34,240
this
1361
00:59:34,240 --> 00:59:37,119
dollar sign ut5
1362
00:59:37,119 --> 00:59:39,119
dot go
1363
00:59:39,119 --> 00:59:41,280
to
1364
00:59:43,280 --> 00:59:46,640
and we pass in the duration
1365
00:59:46,640 --> 00:59:50,720
and we wanted to take one second
1366
00:59:51,200 --> 00:59:55,680
so if we add this to our home page then
1367
00:59:56,400 --> 00:59:59,040
we should see it appear once we scroll
1368
00:59:59,040 --> 01:00:02,319
down on the screen
1369
01:00:03,920 --> 01:00:07,440
so let's jump back to chrome
1370
01:00:09,680 --> 01:00:11,760
and refresh for good little
1371
01:00:11,760 --> 01:00:15,440
scroll down and it appears
1372
01:00:15,440 --> 01:00:17,760
and if you click
1373
01:00:17,760 --> 01:00:21,599
scrolls back up and disappears
1374
01:00:22,160 --> 01:00:23,920
all right good
1375
01:00:23,920 --> 01:00:25,040
um
1376
01:00:25,040 --> 01:00:26,720
you will notice that it's just jumping
1377
01:00:26,720 --> 01:00:28,480
on off the screen
1378
01:00:28,480 --> 01:00:30,160
but we wanted to actually transition in
1379
01:00:30,160 --> 01:00:32,079
and out so we're going to use another
1380
01:00:32,079 --> 01:00:34,559
component from beautify
1381
01:00:34,559 --> 01:00:36,720
it's called
1382
01:00:36,720 --> 01:00:39,440
fab transistor
1383
01:00:39,599 --> 01:00:41,119
so
1384
01:00:41,119 --> 01:00:42,400
v
1385
01:00:42,400 --> 01:00:44,720
type transition
1386
01:00:44,720 --> 01:00:47,839
let's just move this on
1387
01:00:49,839 --> 01:00:53,680
and if we go back to chrome
1388
01:00:55,200 --> 01:00:57,040
you see we have
1389
01:00:57,040 --> 01:01:01,040
a nicer looking transition taking place
1390
01:01:03,040 --> 01:01:05,760
all right so that's it for the most part
1391
01:01:05,760 --> 01:01:07,359
for the home screen
1392
01:01:07,359 --> 01:01:09,520
uh
1393
01:01:09,520 --> 01:01:10,559
next
1394
01:01:10,559 --> 01:01:15,200
we will uh create our products page
1395
01:01:15,200 --> 01:01:18,960
so let's jump back to vs code and
1396
01:01:18,960 --> 01:01:21,520
close this
1397
01:01:22,000 --> 01:01:26,640
and we want to create a page called
1398
01:01:26,640 --> 01:01:28,640
products
1399
01:01:28,640 --> 01:01:31,599
so products slash
1400
01:01:31,599 --> 01:01:34,599
index.view
1401
01:01:36,720 --> 01:01:39,680
and in this product page
1402
01:01:39,680 --> 01:01:41,599
we will have
1403
01:01:41,599 --> 01:01:44,799
our navigation bar at the top as well
1404
01:01:44,799 --> 01:01:45,839
so
1405
01:01:45,839 --> 01:01:48,480
let's just bring that in
1406
01:01:48,480 --> 01:01:50,559
and we can bring it in by just going
1407
01:01:50,559 --> 01:01:51,680
over here
1408
01:01:51,680 --> 01:01:54,799
and copying this now
1409
01:01:59,839 --> 01:02:01,359
and that should be it
1410
01:02:01,359 --> 01:02:03,920
so let's let's take a look to see if
1411
01:02:03,920 --> 01:02:07,839
that's actually a thing in chrome
1412
01:02:08,240 --> 01:02:11,599
so if we navigate to products
1413
01:02:12,720 --> 01:02:14,160
we have our number
1414
01:02:14,160 --> 01:02:16,079
if we click here
1415
01:02:16,079 --> 01:02:17,920
we go back to the home page
1416
01:02:17,920 --> 01:02:19,680
but we want to be able to click on a
1417
01:02:19,680 --> 01:02:21,280
button and not type in products in the
1418
01:02:21,280 --> 01:02:24,799
url so let's hook this button up to our
1419
01:02:24,799 --> 01:02:26,559
products page
1420
01:02:26,559 --> 01:02:30,079
so back in vs code
1421
01:02:30,240 --> 01:02:32,160
we will just go to
1422
01:02:32,160 --> 01:02:35,720
on off components
1423
01:02:35,839 --> 01:02:37,359
and for
1424
01:02:37,359 --> 01:02:39,680
or store button
1425
01:02:39,680 --> 01:02:41,760
just add the nox prop
1426
01:02:41,760 --> 01:02:43,200
on the two prop
1427
01:02:43,200 --> 01:02:46,000
and you want to go to products
1428
01:02:46,000 --> 01:02:47,440
hit save
1429
01:02:47,440 --> 01:02:50,480
go back to chrome
1430
01:02:50,480 --> 01:02:52,640
and when we hit this
1431
01:02:52,640 --> 01:02:55,520
it takes us to the product space nice
1432
01:02:55,520 --> 01:02:58,160
alright so on the products page we want
1433
01:02:58,160 --> 01:03:00,559
to add a few elements
1434
01:03:00,559 --> 01:03:01,440
let's
1435
01:03:01,440 --> 01:03:03,599
close this
1436
01:03:03,599 --> 01:03:06,880
and the first thing we want to add
1437
01:03:06,880 --> 01:03:09,599
is the
1438
01:03:09,599 --> 01:03:13,680
section to display our categories and
1439
01:03:13,680 --> 01:03:15,680
the search
1440
01:03:15,680 --> 01:03:20,640
input field so let's create a container
1441
01:03:22,640 --> 01:03:24,480
let's put a row
1442
01:03:24,480 --> 01:03:27,359
in this container
1443
01:03:27,760 --> 01:03:31,160
make it dense
1444
01:03:31,359 --> 01:03:32,799
now the
1445
01:03:32,799 --> 01:03:35,520
left side of the screen
1446
01:03:35,520 --> 01:03:38,480
we're just going to take up three
1447
01:03:38,480 --> 01:03:42,720
of the 12 spaces in the grid system
1448
01:03:42,720 --> 01:03:43,520
so
1449
01:03:43,520 --> 01:03:46,240
we column
1450
01:03:46,240 --> 01:03:47,680
and we want
1451
01:03:47,680 --> 01:03:48,559
or
1452
01:03:48,559 --> 01:03:50,960
column pick up three on medium on up
1453
01:03:50,960 --> 01:03:53,119
screens
1454
01:03:53,119 --> 01:03:56,880
and we're going to add a div
1455
01:03:57,440 --> 01:03:58,559
with the
1456
01:03:58,559 --> 01:04:01,280
text field
1457
01:04:02,079 --> 01:04:04,640
so we're gonna add an icon
1458
01:04:04,640 --> 01:04:06,480
to the text field which is the search
1459
01:04:06,480 --> 01:04:08,880
icon
1460
01:04:11,359 --> 01:04:13,039
this is going to be an outline text
1461
01:04:13,039 --> 01:04:14,000
field
1462
01:04:14,000 --> 01:04:16,880
it's going to be clear now as well
1463
01:04:16,880 --> 01:04:19,039
i'm going to give it a placeholder of
1464
01:04:19,039 --> 01:04:21,599
search
1465
01:04:23,839 --> 01:04:25,520
i want to save that and head back to
1466
01:04:25,520 --> 01:04:27,839
chrome
1467
01:04:28,960 --> 01:04:31,599
and go to the products page
1468
01:04:31,599 --> 01:04:32,960
you see this here
1469
01:04:32,960 --> 01:04:35,359
and it's clear
1470
01:04:35,359 --> 01:04:37,599
good
1471
01:04:38,319 --> 01:04:41,920
so hit boxes to vs code
1472
01:04:41,920 --> 01:04:43,839
and let's
1473
01:04:43,839 --> 01:04:45,280
add our
1474
01:04:45,280 --> 01:04:46,960
categories
1475
01:04:46,960 --> 01:04:49,440
so the list item shown our categories
1476
01:04:49,440 --> 01:04:52,400
will need the information from our
1477
01:04:52,400 --> 01:04:55,520
content follow um in order to get that
1478
01:04:55,520 --> 01:04:58,000
information we'll have to
1479
01:04:58,000 --> 01:05:01,680
get the data on in the created hook so
1480
01:05:01,680 --> 01:05:04,559
let's just copy this um from over our
1481
01:05:04,559 --> 01:05:07,880
index page
1482
01:05:08,160 --> 01:05:10,880
paste it here
1483
01:05:11,039 --> 01:05:13,359
no we don't want the sale items we want
1484
01:05:13,359 --> 01:05:16,240
categories
1485
01:05:16,240 --> 01:05:19,760
i want to say it is our categories
1486
01:05:19,760 --> 01:05:20,839
is equal
1487
01:05:20,839 --> 01:05:24,160
to the content
1488
01:05:24,160 --> 01:05:28,160
and then the chat equally folder
1489
01:05:28,160 --> 01:05:30,000
which is
1490
01:05:30,000 --> 01:05:31,680
this photo
1491
01:05:31,680 --> 01:05:34,480
and we're not using nowhere clause
1492
01:05:34,480 --> 01:05:36,319
we're just going to fetch everything
1493
01:05:36,319 --> 01:05:39,359
same thing for the products
1494
01:05:39,359 --> 01:05:41,520
now once we hit save
1495
01:05:41,520 --> 01:05:44,400
um and refresh our web page
1496
01:05:44,400 --> 01:05:46,000
we should
1497
01:05:46,000 --> 01:05:48,000
see the
1498
01:05:48,000 --> 01:05:49,599
categories
1499
01:05:49,599 --> 01:05:52,720
with a view dev tool
1500
01:05:55,680 --> 01:05:56,720
under here
1501
01:05:56,720 --> 01:05:59,280
categories
1502
01:05:59,280 --> 01:06:00,880
products
1503
01:06:00,880 --> 01:06:03,880
good
1504
01:06:04,960 --> 01:06:07,039
so now that we have the um the
1505
01:06:07,039 --> 01:06:09,920
categories and the products in our page
1506
01:06:09,920 --> 01:06:11,280
we
1507
01:06:11,280 --> 01:06:13,440
want to start rendering them
1508
01:06:13,440 --> 01:06:17,039
to render them we'll actually use uh
1509
01:06:17,039 --> 01:06:19,710
a list so below or
1510
01:06:19,710 --> 01:06:21,200
[Music]
1511
01:06:21,200 --> 01:06:22,720
text field
1512
01:06:22,720 --> 01:06:26,400
we'll just add a vlist
1513
01:06:26,400 --> 01:06:27,359
v
1514
01:06:27,359 --> 01:06:29,599
list
1515
01:06:29,680 --> 01:06:31,200
now we're going to add the subheader
1516
01:06:31,200 --> 01:06:33,440
prop because we're gonna add a subheader
1517
01:06:33,440 --> 01:06:34,559
in this list
1518
01:06:34,559 --> 01:06:39,240
and the color is going to be transparent
1519
01:06:39,520 --> 01:06:42,160
we also only want to show this list if
1520
01:06:42,160 --> 01:06:45,280
we are on medium sized screens on up
1521
01:06:45,280 --> 01:06:47,280
and to do that with beautify
1522
01:06:47,280 --> 01:06:49,119
you just say dollar sign beautify the
1523
01:06:49,119 --> 01:06:51,520
breakpoint
1524
01:06:51,520 --> 01:06:53,680
dot md and
1525
01:06:53,680 --> 01:06:55,839
up
1526
01:06:57,680 --> 01:07:00,799
and let's add or sub head up so v sub
1527
01:07:00,799 --> 01:07:02,079
header
1528
01:07:02,079 --> 01:07:05,680
and this will be categories
1529
01:07:05,680 --> 01:07:08,240
and then we're gonna add our list items
1530
01:07:08,240 --> 01:07:09,920
so like i said earlier we're just gonna
1531
01:07:09,920 --> 01:07:12,480
loop over
1532
01:07:12,480 --> 01:07:14,160
the
1533
01:07:14,160 --> 01:07:15,760
categories
1534
01:07:15,760 --> 01:07:17,599
so that's a v4
1535
01:07:17,599 --> 01:07:19,440
and then we're just gonna add
1536
01:07:19,440 --> 01:07:22,400
the image and the name of the category
1537
01:07:22,400 --> 01:07:23,520
to do this
1538
01:07:23,520 --> 01:07:24,559
so
1539
01:07:24,559 --> 01:07:25,680
vls
1540
01:07:25,680 --> 01:07:29,319
item avatar
1541
01:07:30,079 --> 01:07:33,200
just add the image
1542
01:07:33,200 --> 01:07:34,880
and it's going to be
1543
01:07:34,880 --> 01:07:35,920
c
1544
01:07:35,920 --> 01:07:38,240
image
1545
01:07:38,880 --> 01:07:42,440
let's close this
1546
01:07:42,799 --> 01:07:46,400
and for the list content
1547
01:07:46,480 --> 01:07:49,680
we're gonna add the title
1548
01:07:54,240 --> 01:07:58,480
and it's going to be c dot name
1549
01:07:58,480 --> 01:08:00,559
all right so let's save this and go back
1550
01:08:00,559 --> 01:08:04,559
to chrome and see what's happening
1551
01:08:05,440 --> 01:08:07,520
and there there
1552
01:08:07,520 --> 01:08:09,680
are categories with images
1553
01:08:09,680 --> 01:08:11,839
so
1554
01:08:12,799 --> 01:08:15,520
you can search for product
1555
01:08:15,520 --> 01:08:16,719
and
1556
01:08:16,719 --> 01:08:19,120
in a real world application you will
1557
01:08:19,120 --> 01:08:20,719
you'll be able to click on these things
1558
01:08:20,719 --> 01:08:22,319
and it will filter
1559
01:08:22,319 --> 01:08:26,158
the products that um
1560
01:08:26,158 --> 01:08:28,719
are in the different categories
1561
01:08:28,719 --> 01:08:32,000
all right so back to vs code
1562
01:08:33,439 --> 01:08:36,839
and we now want to render our
1563
01:08:36,839 --> 01:08:40,159
products so
1564
01:08:40,799 --> 01:08:43,040
in this
1565
01:08:43,040 --> 01:08:45,520
column we can minimize this
1566
01:08:45,520 --> 01:08:47,359
and
1567
01:08:47,359 --> 01:08:50,000
next column
1568
01:08:50,080 --> 01:08:54,719
we're going to give this uh nine spaces
1569
01:08:54,719 --> 01:08:59,120
and then we're going to use a row
1570
01:08:59,759 --> 01:09:03,120
to display the different um products
1571
01:09:03,120 --> 01:09:06,799
so instead of putting the v4 on the
1572
01:09:06,799 --> 01:09:08,399
column within the row
1573
01:09:08,399 --> 01:09:10,238
i'm just going to use a template to
1574
01:09:10,238 --> 01:09:12,000
iterate over
1575
01:09:12,000 --> 01:09:15,480
the different products
1576
01:09:22,158 --> 01:09:24,799
and then inside the template we use the
1577
01:09:24,799 --> 01:09:27,199
column
1578
01:09:28,080 --> 01:09:29,759
and
1579
01:09:29,759 --> 01:09:32,960
the column on smaller screens gonna take
1580
01:09:32,960 --> 01:09:34,560
up all the space
1581
01:09:34,560 --> 01:09:38,000
and on larger screens just six
1582
01:09:38,000 --> 01:09:40,960
we need to assign a key
1583
01:09:40,960 --> 01:09:43,839
to the column as well
1584
01:09:43,839 --> 01:09:45,839
since it's
1585
01:09:45,839 --> 01:09:47,520
inside
1586
01:09:47,520 --> 01:09:49,839
an element with v4
1587
01:09:49,839 --> 01:09:53,520
let's just name this product
1588
01:09:54,080 --> 01:09:56,159
p the id
1589
01:09:56,159 --> 01:09:57,679
and we can use
1590
01:09:57,679 --> 01:10:01,159
i as well
1591
01:10:04,159 --> 01:10:06,239
so
1592
01:10:06,239 --> 01:10:07,760
inside this card
1593
01:10:07,760 --> 01:10:09,120
inside this column we're going to add a
1594
01:10:09,120 --> 01:10:10,880
card
1595
01:10:10,880 --> 01:10:13,679
and of course this is going to be a link
1596
01:10:13,679 --> 01:10:17,520
to the product details page later on
1597
01:10:17,520 --> 01:10:21,600
we're going to add a color of surface
1598
01:10:21,679 --> 01:10:24,719
and a class
1599
01:10:24,719 --> 01:10:25,760
of l
1600
01:10:25,760 --> 01:10:26,640
to
1601
01:10:26,640 --> 01:10:28,840
override the elevation
1602
01:10:28,840 --> 01:10:33,760
um margin of 2 all around
1603
01:10:33,760 --> 01:10:35,360
margin bottom
1604
01:10:35,360 --> 01:10:38,320
of 5 margin right
1605
01:10:38,320 --> 01:10:40,880
of 5.
1606
01:10:42,960 --> 01:10:45,679
and then we can close this card and
1607
01:10:45,679 --> 01:10:47,120
let's add the
1608
01:10:47,120 --> 01:10:48,560
the information that we want to display
1609
01:10:48,560 --> 01:10:51,120
about broken the card here
1610
01:10:51,120 --> 01:10:54,719
so we're going to add the image
1611
01:10:54,800 --> 01:10:57,920
and bind the source to the products
1612
01:10:57,920 --> 01:11:00,640
image url
1613
01:11:00,640 --> 01:11:04,480
and give it a height of 300
1614
01:11:04,960 --> 01:11:07,840
and of course in this image we can add
1615
01:11:07,840 --> 01:11:08,560
the
1616
01:11:08,560 --> 01:11:10,640
placeholder as well
1617
01:11:10,640 --> 01:11:12,320
so let's just copy this prop and paste
1618
01:11:12,320 --> 01:11:14,640
it in
1619
01:11:16,159 --> 01:11:18,560
below the image we want to add
1620
01:11:18,560 --> 01:11:20,880
our title
1621
01:11:20,880 --> 01:11:22,880
so i'm going to copy this and paste it
1622
01:11:22,880 --> 01:11:25,280
in as well
1623
01:11:25,280 --> 01:11:28,560
so it has a class of um
1624
01:11:28,560 --> 01:11:31,199
text body one on medium screens on up
1625
01:11:31,199 --> 01:11:35,040
and a fun way of bold and all screens
1626
01:11:35,040 --> 01:11:38,080
the price
1627
01:11:38,159 --> 01:11:40,239
of the product will below this in our
1628
01:11:40,239 --> 01:11:42,000
subtitle component
1629
01:11:42,000 --> 01:11:44,560
this card subtitle and we'll make the
1630
01:11:44,560 --> 01:11:46,960
text color primary um give it some
1631
01:11:46,960 --> 01:11:49,360
pattern bottom of three and just render
1632
01:11:49,360 --> 01:11:50,800
the price here
1633
01:11:50,800 --> 01:11:55,120
we also want to add the
1634
01:11:55,120 --> 01:11:56,159
tags
1635
01:11:56,159 --> 01:11:58,080
associated with the product
1636
01:11:58,080 --> 01:12:00,080
so we just put that in a vcard text
1637
01:12:00,080 --> 01:12:02,159
component and it's the same
1638
01:12:02,159 --> 01:12:02,960
chip
1639
01:12:02,960 --> 01:12:05,360
from our
1640
01:12:05,360 --> 01:12:07,679
product slider component
1641
01:12:07,679 --> 01:12:11,280
so we can save this
1642
01:12:11,280 --> 01:12:13,440
and check our chrome
1643
01:12:13,440 --> 01:12:15,360
to see
1644
01:12:15,360 --> 01:12:18,000
what's happening
1645
01:12:18,000 --> 01:12:19,120
and there we go
1646
01:12:19,120 --> 01:12:21,280
our products are in
1647
01:12:21,280 --> 01:12:24,159
and looking good
1648
01:12:27,520 --> 01:12:29,920
now we want to be able to search
1649
01:12:29,920 --> 01:12:30,880
here
1650
01:12:30,880 --> 01:12:33,280
to find different products
1651
01:12:33,280 --> 01:12:35,679
you can see no it's not working
1652
01:12:35,679 --> 01:12:39,360
so let's just add that functionality
1653
01:12:41,280 --> 01:12:45,120
so back in vs code we have to create a
1654
01:12:45,120 --> 01:12:46,320
filter
1655
01:12:46,320 --> 01:12:49,120
computed property that will filter the
1656
01:12:49,120 --> 01:12:52,239
actual um results as we search
1657
01:12:52,239 --> 01:12:56,320
so let's create a search property first
1658
01:12:56,320 --> 01:12:57,920
set it to null
1659
01:12:57,920 --> 01:12:59,600
and bind or
1660
01:12:59,600 --> 01:13:02,960
text field up here to this
1661
01:13:02,960 --> 01:13:05,280
property
1662
01:13:05,280 --> 01:13:08,320
so let's just search
1663
01:13:09,280 --> 01:13:13,280
and in our computer property
1664
01:13:14,320 --> 01:13:18,159
we're going to have a property called um
1665
01:13:18,159 --> 01:13:20,000
filtered
1666
01:13:20,000 --> 01:13:22,640
products
1667
01:13:25,280 --> 01:13:28,159
first we're going to check if
1668
01:13:28,159 --> 01:13:29,920
the
1669
01:13:29,920 --> 01:13:34,159
search term is null or empty
1670
01:13:34,159 --> 01:13:35,040
or
1671
01:13:35,040 --> 01:13:38,159
if there are no products
1672
01:13:39,040 --> 01:13:40,960
so for some strange reason we didn't
1673
01:13:40,960 --> 01:13:43,920
load any products
1674
01:13:43,920 --> 01:13:45,199
we're just gonna
1675
01:13:45,199 --> 01:13:46,960
return
1676
01:13:46,960 --> 01:13:48,560
this
1677
01:13:48,560 --> 01:13:50,880
products
1678
01:13:50,880 --> 01:13:54,320
or this empty array
1679
01:13:54,960 --> 01:13:56,640
now if we do have
1680
01:13:56,640 --> 01:14:00,480
um something in our search field and
1681
01:14:00,480 --> 01:14:01,520
something
1682
01:14:01,520 --> 01:14:02,800
in products
1683
01:14:02,800 --> 01:14:05,120
then we want to return
1684
01:14:05,120 --> 01:14:06,080
um
1685
01:14:06,080 --> 01:14:08,719
products based on the user search term
1686
01:14:08,719 --> 01:14:12,239
so we're going to say this.products
1687
01:14:12,320 --> 01:14:15,320
filter
1688
01:14:16,880 --> 01:14:20,320
uh let's just um declare these variables
1689
01:14:20,320 --> 01:14:22,400
locally to this function
1690
01:14:22,400 --> 01:14:25,520
so s is going to be the search term
1691
01:14:25,520 --> 01:14:28,760
so lowercase
1692
01:14:29,840 --> 01:14:33,199
and that's not working
1693
01:14:36,640 --> 01:14:39,120
the name is gonna be
1694
01:14:39,120 --> 01:14:41,120
the name of the product that's been
1695
01:14:41,120 --> 01:14:44,560
passed in this filter function
1696
01:14:44,560 --> 01:14:47,600
to lowercase as well
1697
01:14:49,360 --> 01:14:52,239
the price
1698
01:14:52,239 --> 01:14:57,159
is going to be the price of the product
1699
01:14:57,199 --> 01:14:59,760
to string
1700
01:15:02,400 --> 01:15:03,920
the string is written like this so
1701
01:15:03,920 --> 01:15:06,480
command t
1702
01:15:08,080 --> 01:15:09,440
and
1703
01:15:09,440 --> 01:15:12,480
for the sales price
1704
01:15:12,480 --> 01:15:14,640
uh also for sp
1705
01:15:14,640 --> 01:15:17,040
and it's going to be
1706
01:15:17,040 --> 01:15:20,400
p dot sale price
1707
01:15:20,400 --> 01:15:22,159
and we're going to check if this value
1708
01:15:22,159 --> 01:15:24,560
exists and if it does exist
1709
01:15:24,560 --> 01:15:25,520
um
1710
01:15:25,520 --> 01:15:27,600
we're gonna call the tostring method on
1711
01:15:27,600 --> 01:15:28,320
it
1712
01:15:28,320 --> 01:15:30,960
otherwise we're just gonna pass in an
1713
01:15:30,960 --> 01:15:32,719
empty string
1714
01:15:32,719 --> 01:15:33,920
and
1715
01:15:33,920 --> 01:15:36,400
the rating is gonna p
1716
01:15:36,400 --> 01:15:39,840
dot ratings
1717
01:15:43,600 --> 01:15:45,679
and from this filter function we just
1718
01:15:45,679 --> 01:15:47,360
want to return
1719
01:15:47,360 --> 01:15:48,880
n
1720
01:15:48,880 --> 01:15:50,640
which is a name
1721
01:15:50,640 --> 01:15:52,640
if it includes
1722
01:15:52,640 --> 01:15:54,560
s
1723
01:15:54,560 --> 01:15:56,480
or
1724
01:15:56,480 --> 01:15:58,880
if price
1725
01:15:58,880 --> 01:16:01,520
includes s
1726
01:16:01,520 --> 01:16:02,400
or
1727
01:16:02,400 --> 01:16:04,560
s price
1728
01:16:04,560 --> 01:16:06,960
includes s
1729
01:16:06,960 --> 01:16:08,000
or
1730
01:16:08,000 --> 01:16:09,920
if the rating
1731
01:16:09,920 --> 01:16:11,520
includes
1732
01:16:11,520 --> 01:16:13,679
s
1733
01:16:14,480 --> 01:16:16,800
so if we save this
1734
01:16:16,800 --> 01:16:21,120
we can now change the
1735
01:16:21,120 --> 01:16:23,120
products here
1736
01:16:23,120 --> 01:16:26,320
so filter products
1737
01:16:26,800 --> 01:16:28,400
i want to save that you can head back to
1738
01:16:28,400 --> 01:16:30,239
browser
1739
01:16:30,239 --> 01:16:32,400
and see if everything is working so
1740
01:16:32,400 --> 01:16:36,320
let's refresh this let's type in yep
1741
01:16:36,320 --> 01:16:38,239
beats
1742
01:16:38,239 --> 01:16:41,520
and if we type in like
1743
01:16:41,520 --> 01:16:42,800
yep
1744
01:16:42,800 --> 01:16:44,560
and if we clear this
1745
01:16:44,560 --> 01:16:48,320
it returns all the products
1746
01:16:48,320 --> 01:16:50,560
good
1747
01:16:50,800 --> 01:16:52,080
all right so now that we have the
1748
01:16:52,080 --> 01:16:55,040
products categories it's been filtered
1749
01:16:55,040 --> 01:16:59,040
we can add the footage to this page and
1750
01:16:59,040 --> 01:17:01,520
the scroll to top one
1751
01:17:01,520 --> 01:17:05,520
so let's jump back to vs code
1752
01:17:05,520 --> 01:17:07,760
and let's just
1753
01:17:07,760 --> 01:17:09,200
copy them from over here
1754
01:17:09,200 --> 01:17:12,080
[Music]
1755
01:17:12,080 --> 01:17:14,840
and paste them at the bottom of
1756
01:17:14,840 --> 01:17:17,600
this let's see what they look like
1757
01:17:17,600 --> 01:17:20,320
in chrome
1758
01:17:23,920 --> 01:17:26,400
all right good
1759
01:17:26,400 --> 01:17:28,719
so now we need to add the details page
1760
01:17:28,719 --> 01:17:31,280
for each product um we won't be adding
1761
01:17:31,280 --> 01:17:33,040
it for each product we're just gonna
1762
01:17:33,040 --> 01:17:34,560
navigate to
1763
01:17:34,560 --> 01:17:37,840
a url with a product id in it and then
1764
01:17:37,840 --> 01:17:39,679
you can get a product information based
1765
01:17:39,679 --> 01:17:42,320
on that uh url param so when you go to
1766
01:17:42,320 --> 01:17:45,920
product slash 1 or 151
1767
01:17:45,920 --> 01:17:49,040
it should load the product information
1768
01:17:49,040 --> 01:17:52,080
that corresponds with this product id
1769
01:17:52,080 --> 01:17:55,840
so let's jump back to bs code
1770
01:17:56,480 --> 01:18:00,000
and let's create this product page
1771
01:18:01,280 --> 01:18:02,239
so
1772
01:18:02,239 --> 01:18:03,600
we can
1773
01:18:03,600 --> 01:18:06,320
close these i think
1774
01:18:06,320 --> 01:18:10,800
and go to pages products
1775
01:18:11,040 --> 01:18:13,920
underscore dot view
1776
01:18:13,920 --> 01:18:17,120
let's go idle view
1777
01:18:18,480 --> 01:18:20,400
so let's go to div
1778
01:18:20,400 --> 01:18:25,000
and let's add a navigation bar
1779
01:18:29,679 --> 01:18:30,800
and then
1780
01:18:30,800 --> 01:18:33,360
let's call the product information based
1781
01:18:33,360 --> 01:18:34,400
on the
1782
01:18:34,400 --> 01:18:36,239
url parameter
1783
01:18:36,239 --> 01:18:38,560
of id for this product
1784
01:18:38,560 --> 01:18:41,520
so once this page is created
1785
01:18:41,520 --> 01:18:43,280
we want to call
1786
01:18:43,280 --> 01:18:44,320
the
1787
01:18:44,320 --> 01:18:46,640
um
1788
01:18:46,960 --> 01:18:49,360
we want to get the information from the
1789
01:18:49,360 --> 01:18:50,719
content folder
1790
01:18:50,719 --> 01:18:51,520
so
1791
01:18:51,520 --> 01:18:54,640
let's copy and paste this in and instead
1792
01:18:54,640 --> 01:18:57,679
of products let's just say product
1793
01:18:57,679 --> 01:19:01,840
and the product is going to be
1794
01:19:02,800 --> 01:19:05,600
this content products
1795
01:19:05,600 --> 01:19:09,320
dot where
1796
01:19:09,360 --> 01:19:12,080
the id
1797
01:19:12,640 --> 01:19:13,520
is
1798
01:19:13,520 --> 01:19:16,960
equal to the id that's passed in
1799
01:19:16,960 --> 01:19:20,000
via the road params um this id that's
1800
01:19:20,000 --> 01:19:22,239
passed in from param is actually a
1801
01:19:22,239 --> 01:19:24,480
string so we need to convert that's one
1802
01:19:24,480 --> 01:19:26,800
integer because the
1803
01:19:26,800 --> 01:19:29,600
um json file there are integers here
1804
01:19:29,600 --> 01:19:30,960
there are strings
1805
01:19:30,960 --> 01:19:32,000
so
1806
01:19:32,000 --> 01:19:35,440
let's just use parseint
1807
01:19:35,440 --> 01:19:37,920
and we're going to get this
1808
01:19:37,920 --> 01:19:40,000
router
1809
01:19:40,000 --> 01:19:43,199
the params
1810
01:19:43,199 --> 01:19:45,600
id
1811
01:19:46,239 --> 01:19:47,120
uh
1812
01:19:47,120 --> 01:19:48,400
it should
1813
01:19:48,400 --> 01:19:50,640
send back only one
1814
01:19:50,640 --> 01:19:53,520
um item but we can explicitly
1815
01:19:53,520 --> 01:19:56,960
tell the content module to limit it
1816
01:19:56,960 --> 01:19:59,120
to only one
1817
01:19:59,120 --> 01:20:02,159
and we want to fetch that information
1818
01:20:02,159 --> 01:20:04,320
this thing is going to return an array
1819
01:20:04,320 --> 01:20:08,080
so it will be best to store
1820
01:20:08,080 --> 01:20:10,880
the response in a variable
1821
01:20:10,880 --> 01:20:13,280
let's say counts
1822
01:20:13,280 --> 01:20:15,360
p
1823
01:20:15,360 --> 01:20:18,800
and then we can say the product is equal
1824
01:20:18,800 --> 01:20:21,040
to p
1825
01:20:21,040 --> 01:20:23,520
the first item in p
1826
01:20:23,520 --> 01:20:25,360
of course we need to create this product
1827
01:20:25,360 --> 01:20:26,800
variable
1828
01:20:26,800 --> 01:20:28,960
so
1829
01:20:29,440 --> 01:20:30,960
let's just put it there
1830
01:20:30,960 --> 01:20:33,840
and set it to null
1831
01:20:34,400 --> 01:20:36,719
all right so now if we should navigate
1832
01:20:36,719 --> 01:20:38,080
to this page
1833
01:20:38,080 --> 01:20:39,679
it should pull
1834
01:20:39,679 --> 01:20:41,840
the
1835
01:20:42,080 --> 01:20:43,920
product information
1836
01:20:43,920 --> 01:20:47,040
for the product with the id in the
1837
01:20:47,040 --> 01:20:49,440
params object
1838
01:20:49,440 --> 01:20:52,239
to navigate to this page to this page to
1839
01:20:52,239 --> 01:20:53,920
navigate to this page
1840
01:20:53,920 --> 01:20:56,239
um we need to add a
1841
01:20:56,239 --> 01:20:58,800
click function to the different
1842
01:20:58,800 --> 01:21:01,280
products so let's go to the products
1843
01:21:01,280 --> 01:21:02,639
title
1844
01:21:02,639 --> 01:21:05,679
and on this card
1845
01:21:05,679 --> 01:21:08,639
we can just add nox
1846
01:21:08,639 --> 01:21:10,080
to
1847
01:21:10,080 --> 01:21:13,960
and we want to go to products
1848
01:21:16,239 --> 01:21:17,360
the
1849
01:21:17,360 --> 01:21:18,480
product
1850
01:21:18,480 --> 01:21:21,040
id
1851
01:21:22,080 --> 01:21:24,880
and we want to add this
1852
01:21:24,880 --> 01:21:26,840
this piece of code
1853
01:21:26,840 --> 01:21:30,719
to hmm where did we want to add this to
1854
01:21:30,719 --> 01:21:32,719
the home carousels button as well so
1855
01:21:32,719 --> 01:21:34,639
here where it says checked out
1856
01:21:34,639 --> 01:21:36,960
we want to navigate to the product
1857
01:21:36,960 --> 01:21:38,880
um detail page as well
1858
01:21:38,880 --> 01:21:41,199
so let's add it there
1859
01:21:41,199 --> 01:21:42,800
and i think
1860
01:21:42,800 --> 01:21:45,120
that's it
1861
01:21:45,120 --> 01:21:47,280
let's jump back to chrome and see what's
1862
01:21:47,280 --> 01:21:49,600
happening
1863
01:21:49,600 --> 01:21:51,840
so let's go to the home page if i click
1864
01:21:51,840 --> 01:21:53,920
on this
1865
01:21:53,920 --> 01:21:55,040
oops
1866
01:21:55,040 --> 01:21:57,120
we have an error
1867
01:21:57,120 --> 01:21:59,679
so it cannot read properties of
1868
01:21:59,679 --> 01:22:02,560
undefined it's reading id
1869
01:22:02,560 --> 01:22:05,360
hmm what's causing this
1870
01:22:05,360 --> 01:22:07,679
let's jump back to vs code
1871
01:22:07,679 --> 01:22:09,840
and see what's causing this so from the
1872
01:22:09,840 --> 01:22:10,960
home
1873
01:22:10,960 --> 01:22:13,280
car cell c
1874
01:22:13,280 --> 01:22:15,600
we have p
1875
01:22:15,600 --> 01:22:18,639
p id
1876
01:22:18,800 --> 01:22:21,760
i think the issue is
1877
01:22:21,760 --> 01:22:23,440
here
1878
01:22:23,440 --> 01:22:26,719
yeah this is here so instead of um roto
1879
01:22:26,719 --> 01:22:29,040
it should actually be route
1880
01:22:29,040 --> 01:22:30,920
so this
1881
01:22:30,920 --> 01:22:33,679
downloads the id
1882
01:22:33,679 --> 01:22:37,120
so jump back to chrome and
1883
01:22:37,120 --> 01:22:40,239
refresh this page
1884
01:22:40,880 --> 01:22:42,800
and we have no error
1885
01:22:42,800 --> 01:22:45,280
and if we inspect
1886
01:22:45,280 --> 01:22:48,639
we should see the information for this
1887
01:22:48,639 --> 01:22:50,320
specific product
1888
01:22:50,320 --> 01:22:51,520
and it's here
1889
01:22:51,520 --> 01:22:53,360
so now we can actually render the
1890
01:22:53,360 --> 01:22:55,040
information
1891
01:22:55,040 --> 01:22:56,639
in the template
1892
01:22:56,639 --> 01:22:59,199
so let's jump back to this code
1893
01:22:59,199 --> 01:23:00,719
all right so in this code we want to
1894
01:23:00,719 --> 01:23:02,320
actually render the product on the
1895
01:23:02,320 --> 01:23:03,280
screen
1896
01:23:03,280 --> 01:23:04,000
so
1897
01:23:04,000 --> 01:23:06,560
this will be container
1898
01:23:06,560 --> 01:23:08,960
and we only want to show this if
1899
01:23:08,960 --> 01:23:12,639
the product is present
1900
01:23:13,199 --> 01:23:16,000
we're going to use a row
1901
01:23:16,000 --> 01:23:20,159
let's just justify the center
1902
01:23:20,159 --> 01:23:23,040
and then a column
1903
01:23:23,040 --> 01:23:25,679
on the smaller screens
1904
01:23:25,679 --> 01:23:27,199
11
1905
01:23:27,199 --> 01:23:30,400
for medium one up seven
1906
01:23:30,400 --> 01:23:34,159
so let's display the name of the product
1907
01:23:34,159 --> 01:23:36,560
so i'm going to say product
1908
01:23:36,560 --> 01:23:38,639
dot name
1909
01:23:38,639 --> 01:23:40,719
and let's just style this a little let's
1910
01:23:40,719 --> 01:23:44,000
put it in the center
1911
01:23:45,679 --> 01:23:49,440
change the size on medium screens
1912
01:23:49,440 --> 01:23:52,480
and make it bold
1913
01:23:56,080 --> 01:23:57,120
um
1914
01:23:57,120 --> 01:23:59,760
we're gonna add the rating so let's use
1915
01:23:59,760 --> 01:24:02,639
the written component from beautify
1916
01:24:02,639 --> 01:24:05,280
we're gonna make it read only
1917
01:24:05,280 --> 01:24:07,679
we're gonna unload half increments
1918
01:24:07,679 --> 01:24:10,800
so we can have four and a half stars
1919
01:24:10,800 --> 01:24:13,600
um we're gonna give it a little margin
1920
01:24:13,600 --> 01:24:15,600
from the bottom
1921
01:24:15,600 --> 01:24:19,600
we're gonna make the star colors yellow
1922
01:24:19,600 --> 01:24:23,679
dark and two so a darker shade of yellow
1923
01:24:23,679 --> 01:24:24,480
uh
1924
01:24:24,480 --> 01:24:27,920
a background color for empty stars
1925
01:24:27,920 --> 01:24:31,600
um we're gonna use gray
1926
01:24:33,440 --> 01:24:35,760
the value
1927
01:24:35,760 --> 01:24:37,920
uh this accepts the number as stars that
1928
01:24:37,920 --> 01:24:39,440
you want to be filled out and we're just
1929
01:24:39,440 --> 01:24:42,000
gonna use products.ratings
1930
01:24:42,000 --> 01:24:45,159
for this
1931
01:24:45,280 --> 01:24:47,760
let's change the size of the widget
1932
01:24:47,760 --> 01:24:49,679
itself
1933
01:24:49,679 --> 01:24:53,239
let's close this
1934
01:24:58,880 --> 01:25:01,280
all right after the rating we want to
1935
01:25:01,280 --> 01:25:03,600
add the
1936
01:25:03,600 --> 01:25:05,360
um tags
1937
01:25:05,360 --> 01:25:07,679
so let's just copy the
1938
01:25:07,679 --> 01:25:11,600
tags that we've been using
1939
01:25:11,600 --> 01:25:14,400
the same chips
1940
01:25:17,120 --> 01:25:22,159
and then we're going to render the image
1941
01:25:22,480 --> 01:25:24,480
so instead of
1942
01:25:24,480 --> 01:25:27,040
typing out the entire image
1943
01:25:27,040 --> 01:25:28,480
it's not much
1944
01:25:28,480 --> 01:25:29,600
let's just
1945
01:25:29,600 --> 01:25:31,840
copy and paste the image in
1946
01:25:31,840 --> 01:25:34,320
so it's going to have a width of 100
1947
01:25:34,320 --> 01:25:35,280
um
1948
01:25:35,280 --> 01:25:37,040
that elevation
1949
01:25:37,040 --> 01:25:39,360
around the corners and it's gonna take
1950
01:25:39,360 --> 01:25:43,040
up um 50 of the screen
1951
01:25:43,040 --> 01:25:45,760
we also want to render the description
1952
01:25:45,760 --> 01:25:48,400
of the product
1953
01:25:48,400 --> 01:25:49,840
and then
1954
01:25:49,840 --> 01:25:52,840
we want a bun that will allow us to add
1955
01:25:52,840 --> 01:25:55,600
this specific product to the cart so
1956
01:25:55,600 --> 01:25:58,159
let's create that one
1957
01:25:58,159 --> 01:26:02,159
so the minimum height of 45
1958
01:26:02,159 --> 01:26:06,000
minimum widths of 170
1959
01:26:06,000 --> 01:26:09,600
all it takes to be capitalized
1960
01:26:09,600 --> 01:26:13,679
i want it to have our primary color
1961
01:26:13,679 --> 01:26:16,000
and of course it's just going to say add
1962
01:26:16,000 --> 01:26:19,040
to cart
1963
01:26:19,760 --> 01:26:21,920
so let's save this and see what it looks
1964
01:26:21,920 --> 01:26:24,639
like in chrome
1965
01:26:27,520 --> 01:26:31,199
and this is what it look looks like uh
1966
01:26:31,199 --> 01:26:32,960
i don't know why these things are not
1967
01:26:32,960 --> 01:26:37,239
sent out but let's fix that
1968
01:26:37,360 --> 01:26:40,480
so in vs code
1969
01:26:40,480 --> 01:26:42,159
let's just um
1970
01:26:42,159 --> 01:26:44,800
jump back to the rating
1971
01:26:44,800 --> 01:26:47,360
and i'm going to wrap this thing in
1972
01:26:47,360 --> 01:26:50,239
active
1973
01:26:50,239 --> 01:26:52,239
with a class of
1974
01:26:52,239 --> 01:26:54,960
um center
1975
01:26:54,960 --> 01:26:57,040
and let's see with some margin
1976
01:26:57,040 --> 01:26:58,400
from the top
1977
01:26:58,400 --> 01:27:00,719
so we want the rating to be centered and
1978
01:27:00,719 --> 01:27:04,920
we want the chips to be centered
1979
01:27:08,880 --> 01:27:10,480
good
1980
01:27:10,480 --> 01:27:14,800
so now if we go back to our home screen
1981
01:27:14,800 --> 01:27:16,960
click on any of these things it should
1982
01:27:16,960 --> 01:27:19,440
take us to the details for this
1983
01:27:19,440 --> 01:27:20,719
page
1984
01:27:20,719 --> 01:27:23,040
the same should happen for these as well
1985
01:27:23,040 --> 01:27:25,360
yep
1986
01:27:26,320 --> 01:27:28,719
so from the card
1987
01:27:28,719 --> 01:27:30,840
yep
1988
01:27:30,840 --> 01:27:34,800
good uh now we want to add the
1989
01:27:34,800 --> 01:27:37,120
um footer and the scroll to top button
1990
01:27:37,120 --> 01:27:39,360
to this page so
1991
01:27:39,360 --> 01:27:42,639
let's jump back to vs code
1992
01:27:44,560 --> 01:27:47,040
and let's just copy it from our index
1993
01:27:47,040 --> 01:27:49,600
page
1994
01:27:53,440 --> 01:27:55,199
and put it here
1995
01:27:55,199 --> 01:27:59,239
oh you may want some space
1996
01:28:03,199 --> 01:28:07,040
new mods chrome and there we go
1997
01:28:12,080 --> 01:28:15,080
good
1998
01:28:15,199 --> 01:28:17,199
so now that we've
1999
01:28:17,199 --> 01:28:20,560
added the details page
2000
01:28:20,560 --> 01:28:22,320
we want to
2001
01:28:22,320 --> 01:28:24,639
add the
2002
01:28:24,639 --> 01:28:26,840
add to cart function to our
2003
01:28:26,840 --> 01:28:29,520
application um to accomplish this i'm
2004
01:28:29,520 --> 01:28:32,000
going to use uh ux
2005
01:28:32,000 --> 01:28:35,600
um so let's just jump back to vs code
2006
01:28:35,600 --> 01:28:39,280
and create or
2007
01:28:40,400 --> 01:28:46,560
um cart store in ux or cart folder in ux
2008
01:28:46,560 --> 01:28:47,679
um
2009
01:28:47,679 --> 01:28:50,239
so we'll right click create a new file
2010
01:28:50,239 --> 01:28:52,719
let's call it cart
2011
01:28:52,719 --> 01:28:54,840
state
2012
01:28:54,840 --> 01:28:59,760
js and the state in view x it should
2013
01:28:59,760 --> 01:29:02,000
export a default function
2014
01:29:02,000 --> 01:29:04,000
that returns
2015
01:29:04,000 --> 01:29:09,320
an object so let's just do that
2016
01:29:10,719 --> 01:29:12,159
and return
2017
01:29:12,159 --> 01:29:15,120
an object an english object
2018
01:29:15,120 --> 01:29:16,960
will be our cart
2019
01:29:16,960 --> 01:29:20,080
so initially our cart will just be
2020
01:29:20,080 --> 01:29:21,840
an empty
2021
01:29:21,840 --> 01:29:24,000
array
2022
01:29:24,000 --> 01:29:26,800
we'll also add some mutations
2023
01:29:26,800 --> 01:29:28,880
to this um store
2024
01:29:28,880 --> 01:29:30,880
so let's just create a new file called
2025
01:29:30,880 --> 01:29:33,880
mutations.js
2026
01:29:34,400 --> 01:29:36,239
and mutations
2027
01:29:36,239 --> 01:29:39,840
just export the default object
2028
01:29:39,840 --> 01:29:41,440
and the first
2029
01:29:41,440 --> 01:29:43,199
mutation that we want to add is a
2030
01:29:43,199 --> 01:29:45,199
mutation to
2031
01:29:45,199 --> 01:29:47,639
load the cart
2032
01:29:47,639 --> 01:29:51,679
mutations taking a state and payload
2033
01:29:51,679 --> 01:29:53,040
but for this one
2034
01:29:53,040 --> 01:29:55,840
we don't need a payload justice did
2035
01:29:55,840 --> 01:29:59,920
so we're going to get our cart from
2036
01:29:59,920 --> 01:30:01,440
local storage
2037
01:30:01,440 --> 01:30:04,159
let's just
2038
01:30:04,719 --> 01:30:06,880
try to get it here so it's going to be
2039
01:30:06,880 --> 01:30:10,239
local storage door gets item
2040
01:30:10,239 --> 01:30:14,960
and let's just name it um free cards
2041
01:30:17,840 --> 01:30:20,000
and we're going to check if free card
2042
01:30:20,000 --> 01:30:21,280
exists
2043
01:30:21,280 --> 01:30:22,480
so if
2044
01:30:22,480 --> 01:30:24,480
we have that value
2045
01:30:24,480 --> 01:30:27,040
then we want to set the
2046
01:30:27,040 --> 01:30:30,719
part in our state which is this thing
2047
01:30:30,719 --> 01:30:34,760
we want to set it to
2048
01:30:35,040 --> 01:30:36,320
the
2049
01:30:36,320 --> 01:30:38,719
car that we got from local storage
2050
01:30:38,719 --> 01:30:42,239
so jason parse
2051
01:30:42,960 --> 01:30:45,199
cart
2052
01:30:47,600 --> 01:30:48,480
now
2053
01:30:48,480 --> 01:30:51,920
to add an item to our card
2054
01:30:51,920 --> 01:30:55,679
we are going to have to pass in a pro so
2055
01:30:55,679 --> 01:31:00,000
let's call this function r2 card
2056
01:31:05,679 --> 01:31:07,040
and then
2057
01:31:07,040 --> 01:31:09,040
we want to check
2058
01:31:09,040 --> 01:31:11,600
if the item
2059
01:31:11,600 --> 01:31:14,600
is
2060
01:31:16,159 --> 01:31:20,960
so we're going to say let's item found
2061
01:31:20,960 --> 01:31:24,080
we equal to states
2062
01:31:24,480 --> 01:31:25,840
not find
2063
01:31:25,840 --> 01:31:27,440
and because the card is going to be an
2064
01:31:27,440 --> 01:31:28,560
array
2065
01:31:28,560 --> 01:31:31,920
we can use a find um
2066
01:31:31,920 --> 01:31:33,040
function
2067
01:31:33,040 --> 01:31:35,040
and this takes in
2068
01:31:35,040 --> 01:31:36,800
another function
2069
01:31:36,800 --> 01:31:39,520
that should return a value
2070
01:31:39,520 --> 01:31:40,480
so
2071
01:31:40,480 --> 01:31:44,560
this function will accept a parameter p
2072
01:31:44,560 --> 01:31:46,880
which represents a single product in the
2073
01:31:46,880 --> 01:31:50,159
cart and we're going to check if p
2074
01:31:50,159 --> 01:31:52,719
dot product
2075
01:31:52,719 --> 01:31:54,560
the id
2076
01:31:54,560 --> 01:31:56,639
is exactly equal
2077
01:31:56,639 --> 01:31:58,800
to the product that's been passed in
2078
01:31:58,800 --> 01:32:01,360
which is this
2079
01:32:01,360 --> 01:32:04,320
one's id
2080
01:32:04,560 --> 01:32:06,400
now if we do
2081
01:32:06,400 --> 01:32:08,639
not find it
2082
01:32:08,639 --> 01:32:10,880
so if the item is not found
2083
01:32:10,880 --> 01:32:12,400
then we're going to say stay
2084
01:32:12,400 --> 01:32:14,800
a cart
2085
01:32:14,800 --> 01:32:16,560
now push
2086
01:32:16,560 --> 01:32:18,320
and we're going to push on object we're
2087
01:32:18,320 --> 01:32:20,320
going to pass in the product
2088
01:32:20,320 --> 01:32:22,719
which is this one that's passing
2089
01:32:22,719 --> 01:32:26,000
and then we're going to
2090
01:32:26,000 --> 01:32:29,360
create a quantity field
2091
01:32:29,360 --> 01:32:32,159
and set it to one
2092
01:32:33,440 --> 01:32:34,880
if it does
2093
01:32:34,880 --> 01:32:36,560
exist
2094
01:32:36,560 --> 01:32:38,000
meaning the item that we search for
2095
01:32:38,000 --> 01:32:40,560
exists then we're just gonna increment
2096
01:32:40,560 --> 01:32:44,080
the quantity by one
2097
01:32:46,880 --> 01:32:50,080
all right now after we update the
2098
01:32:50,080 --> 01:32:51,520
card variable
2099
01:32:51,520 --> 01:32:53,280
over here in the state
2100
01:32:53,280 --> 01:32:56,000
we want to save the item to local
2101
01:32:56,000 --> 01:32:57,520
storage
2102
01:32:57,520 --> 01:32:59,120
so we're just going to update local
2103
01:32:59,120 --> 01:33:01,600
storage
2104
01:33:02,960 --> 01:33:05,280
so it's going to be local storage.set
2105
01:33:05,280 --> 01:33:07,199
item
2106
01:33:07,199 --> 01:33:10,960
and up here we call it free card
2107
01:33:11,520 --> 01:33:13,600
so i'm gonna set free cards
2108
01:33:13,600 --> 01:33:15,600
to the stringing five version of our
2109
01:33:15,600 --> 01:33:17,040
card
2110
01:33:17,040 --> 01:33:20,560
so suggestion not stringify
2111
01:33:20,840 --> 01:33:24,080
state dot cards
2112
01:33:24,080 --> 01:33:25,280
and of course
2113
01:33:25,280 --> 01:33:27,520
once the card is updated we want to
2114
01:33:27,520 --> 01:33:30,159
notify or use all to let them know that
2115
01:33:30,159 --> 01:33:31,520
hey
2116
01:33:31,520 --> 01:33:34,080
we updated your card successfully
2117
01:33:34,080 --> 01:33:35,679
so
2118
01:33:35,679 --> 01:33:37,679
we're going to use the um
2119
01:33:37,679 --> 01:33:39,920
sweet alert to do that
2120
01:33:39,920 --> 01:33:43,280
so we're going to set it to a toast
2121
01:33:44,239 --> 01:33:46,719
the texture is going to be
2122
01:33:46,719 --> 01:33:50,000
cut or muted
2123
01:33:50,000 --> 01:33:53,920
gonna use the success icon
2124
01:33:56,239 --> 01:33:57,040
uh
2125
01:33:57,040 --> 01:34:00,960
timer is gonna be four seconds
2126
01:34:01,360 --> 01:34:03,360
we are not going to show the confirm
2127
01:34:03,360 --> 01:34:05,360
button and we're not and we're going to
2128
01:34:05,360 --> 01:34:07,920
show the progress of the title
2129
01:34:07,920 --> 01:34:11,520
we also want to change the position
2130
01:34:11,520 --> 01:34:13,280
to top
2131
01:34:13,280 --> 01:34:15,679
end
2132
01:34:16,000 --> 01:34:19,040
and that's it for the art card function
2133
01:34:19,040 --> 01:34:24,000
uh once an item is in or cart we also
2134
01:34:24,000 --> 01:34:25,040
want
2135
01:34:25,040 --> 01:34:28,960
the ability to decrease the item code
2136
01:34:28,960 --> 01:34:30,480
to remove it
2137
01:34:30,480 --> 01:34:33,360
um remove a specific item um to increase
2138
01:34:33,360 --> 01:34:35,840
the item code until clear the cart
2139
01:34:35,840 --> 01:34:37,040
entirely
2140
01:34:37,040 --> 01:34:39,440
so let's add these functions
2141
01:34:39,440 --> 01:34:43,040
um the decrease
2142
01:34:43,119 --> 01:34:46,880
item count function
2143
01:34:46,880 --> 01:34:49,040
is going to take in
2144
01:34:49,040 --> 01:34:50,639
the index
2145
01:34:50,639 --> 01:34:53,119
of the item that we want to decrease
2146
01:34:53,119 --> 01:34:55,199
we're just going to say let's item equal
2147
01:34:55,199 --> 01:34:56,480
to state
2148
01:34:56,480 --> 01:34:58,560
dot cart
2149
01:34:58,560 --> 01:35:01,840
add the given index
2150
01:35:03,040 --> 01:35:05,600
and then we want to say if we can't find
2151
01:35:05,600 --> 01:35:08,159
this item
2152
01:35:08,480 --> 01:35:12,520
do nothing oh
2153
01:35:14,400 --> 01:35:18,000
and we're gonna check if the
2154
01:35:18,000 --> 01:35:23,040
items quantity is exactly equal to one
2155
01:35:23,040 --> 01:35:25,760
and if it is we're just gonna remove the
2156
01:35:25,760 --> 01:35:28,880
item from the cart entirely because we
2157
01:35:28,880 --> 01:35:30,480
don't want
2158
01:35:30,480 --> 01:35:32,880
um items in our cart with a quantity at
2159
01:35:32,880 --> 01:35:34,560
zero
2160
01:35:34,560 --> 01:35:37,119
so we're going to do state back cart
2161
01:35:37,119 --> 01:35:40,320
box splice
2162
01:35:40,400 --> 01:35:42,719
and we want to start removing the index
2163
01:35:42,719 --> 01:35:44,880
that was passing and want to take off
2164
01:35:44,880 --> 01:35:47,600
one item
2165
01:35:47,920 --> 01:35:49,440
else
2166
01:35:49,440 --> 01:35:51,440
if the quantity isn't one then we're
2167
01:35:51,440 --> 01:35:53,920
going to just
2168
01:35:54,480 --> 01:35:57,679
remove one from the count
2169
01:35:57,679 --> 01:36:00,320
and of course we have to update our um
2170
01:36:00,320 --> 01:36:02,880
user to know that a
2171
01:36:02,880 --> 01:36:05,840
card was updated
2172
01:36:09,760 --> 01:36:11,119
so
2173
01:36:11,119 --> 01:36:14,560
cart updated success message stop in
2174
01:36:14,560 --> 01:36:17,280
and of course we want to update
2175
01:36:17,280 --> 01:36:21,239
local storage again
2176
01:36:26,080 --> 01:36:28,800
so that's the decrease function
2177
01:36:28,800 --> 01:36:31,679
we want the ability to remove an item
2178
01:36:31,679 --> 01:36:32,960
from the card
2179
01:36:32,960 --> 01:36:33,920
so
2180
01:36:33,920 --> 01:36:36,719
let's add that function
2181
01:36:36,719 --> 01:36:40,400
remove cards item
2182
01:36:40,400 --> 01:36:42,480
state
2183
01:36:42,480 --> 01:36:44,960
index
2184
01:36:44,960 --> 01:36:47,679
and we just want to splice
2185
01:36:47,679 --> 01:36:49,840
the
2186
01:36:50,880 --> 01:36:53,760
card state on the given index so we will
2187
01:36:53,760 --> 01:36:56,239
state that card that splice
2188
01:36:56,239 --> 01:36:59,520
index remove one item and of course
2189
01:36:59,520 --> 01:37:02,560
update our user
2190
01:37:03,679 --> 01:37:07,560
and update local storage
2191
01:37:08,560 --> 01:37:12,000
so let's say i don't move
2192
01:37:15,440 --> 01:37:20,239
and then we want to be able to increase
2193
01:37:20,239 --> 01:37:24,960
the item code so let's go increase
2194
01:37:26,000 --> 01:37:29,400
our count
2195
01:37:34,639 --> 01:37:37,280
and let's check for the item
2196
01:37:37,280 --> 01:37:40,320
so the item is going to be
2197
01:37:40,320 --> 01:37:43,440
straight down the card
2198
01:37:44,080 --> 01:37:46,560
index
2199
01:37:47,199 --> 01:37:48,880
and then we just want to increase the
2200
01:37:48,880 --> 01:37:52,400
quantity so plus equal one
2201
01:37:52,400 --> 01:37:56,480
and of course update the user
2202
01:37:58,080 --> 01:38:01,719
on local storage
2203
01:38:09,360 --> 01:38:12,560
and lastly we need a function to clear
2204
01:38:12,560 --> 01:38:15,800
our cart
2205
01:38:16,000 --> 01:38:18,560
uh we won't be passing in anything here
2206
01:38:18,560 --> 01:38:20,719
we'll just like with the state
2207
01:38:20,719 --> 01:38:22,639
and state
2208
01:38:22,639 --> 01:38:23,520
dot
2209
01:38:23,520 --> 01:38:26,000
carts
2210
01:38:26,159 --> 01:38:30,000
is going to be equal to an empty array
2211
01:38:30,000 --> 01:38:33,119
then we want to remove the card key
2212
01:38:33,119 --> 01:38:34,000
from
2213
01:38:34,000 --> 01:38:35,520
local storage
2214
01:38:35,520 --> 01:38:38,320
so free card
2215
01:38:38,320 --> 01:38:41,199
is what we'll be removing
2216
01:38:41,199 --> 01:38:42,800
good
2217
01:38:42,800 --> 01:38:44,719
so now that we have these functions in
2218
01:38:44,719 --> 01:38:45,760
place
2219
01:38:45,760 --> 01:38:48,080
uh one more thing i want to do
2220
01:38:48,080 --> 01:38:51,280
is i want to create a plug-in
2221
01:38:51,280 --> 01:38:53,199
that will actually
2222
01:38:53,199 --> 01:38:55,679
load our car to whenever we start our
2223
01:38:55,679 --> 01:38:57,040
application or
2224
01:38:57,040 --> 01:38:59,760
navigate to anywhere in our application
2225
01:38:59,760 --> 01:39:02,800
to accomplish that we have to use um
2226
01:39:02,800 --> 01:39:04,080
a plugin
2227
01:39:04,080 --> 01:39:08,000
so let's create a plugins directory
2228
01:39:08,000 --> 01:39:09,920
plugins
2229
01:39:09,920 --> 01:39:12,800
plugins
2230
01:39:12,800 --> 01:39:16,320
and let's just name this cart
2231
01:39:16,480 --> 01:39:19,679
plugins card objects
2232
01:39:20,080 --> 01:39:21,360
in this plugin
2233
01:39:21,360 --> 01:39:24,080
we're going to export
2234
01:39:24,080 --> 01:39:27,639
a default function
2235
01:39:29,199 --> 01:39:31,280
and we're going to
2236
01:39:31,280 --> 01:39:33,520
take in the store
2237
01:39:33,520 --> 01:39:35,520
from the context
2238
01:39:35,520 --> 01:39:38,239
on also
2239
01:39:38,239 --> 01:39:42,080
we're going to use the inject function
2240
01:39:42,080 --> 01:39:43,119
uh
2241
01:39:43,119 --> 01:39:45,520
so unload
2242
01:39:45,520 --> 01:39:47,920
we just want to call
2243
01:39:47,920 --> 01:39:50,159
the
2244
01:39:51,760 --> 01:39:55,199
load card method from or mutations here
2245
01:39:55,199 --> 01:39:58,159
so we're just going to say store
2246
01:39:58,159 --> 01:40:00,320
comments
2247
01:40:00,320 --> 01:40:02,480
carts
2248
01:40:02,480 --> 01:40:03,920
and load
2249
01:40:03,920 --> 01:40:06,239
cart
2250
01:40:06,800 --> 01:40:08,560
so once we call this
2251
01:40:08,560 --> 01:40:09,840
um
2252
01:40:09,840 --> 01:40:12,800
it will actually assign
2253
01:40:12,800 --> 01:40:16,800
the card from our local storage to the
2254
01:40:16,800 --> 01:40:19,199
um card state
2255
01:40:19,199 --> 01:40:21,280
the next thing that i want to do is i
2256
01:40:21,280 --> 01:40:24,080
want to inject a function that will
2257
01:40:24,080 --> 01:40:27,600
actually format our prices
2258
01:40:27,600 --> 01:40:28,320
so
2259
01:40:28,320 --> 01:40:30,560
i'm going to inject
2260
01:40:30,560 --> 01:40:33,679
we're going to call this format
2261
01:40:33,679 --> 01:40:36,159
money
2262
01:40:36,159 --> 01:40:40,560
and this inject method takes in the name
2263
01:40:40,560 --> 01:40:42,880
of the function so the name that you
2264
01:40:42,880 --> 01:40:44,480
want to give it globally
2265
01:40:44,480 --> 01:40:45,600
and
2266
01:40:45,600 --> 01:40:47,600
then what should be return or what
2267
01:40:47,600 --> 01:40:49,199
should happen when this function is
2268
01:40:49,199 --> 01:40:52,239
called so it's going to accept
2269
01:40:52,239 --> 01:40:53,920
a param
2270
01:40:53,920 --> 01:40:55,520
it's called money
2271
01:40:55,520 --> 01:40:58,719
and i want to return
2272
01:40:58,719 --> 01:41:01,040
a new
2273
01:41:01,040 --> 01:41:02,080
um
2274
01:41:02,080 --> 01:41:05,520
international number formats
2275
01:41:05,679 --> 01:41:07,760
in the number format we have to pass in
2276
01:41:07,760 --> 01:41:11,040
the locale so i'm going to use in
2277
01:41:11,040 --> 01:41:12,880
us
2278
01:41:12,880 --> 01:41:15,040
and then
2279
01:41:15,040 --> 01:41:15,840
for
2280
01:41:15,840 --> 01:41:16,880
the
2281
01:41:16,880 --> 01:41:20,480
options i'm gonna use currency
2282
01:41:20,480 --> 01:41:23,119
such a tsd
2283
01:41:23,119 --> 01:41:25,199
and style
2284
01:41:25,199 --> 01:41:27,600
should be
2285
01:41:28,239 --> 01:41:31,239
currency
2286
01:41:33,520 --> 01:41:36,880
then we can call the format
2287
01:41:36,880 --> 01:41:39,119
method and pass in what we want to
2288
01:41:39,119 --> 01:41:41,600
format
2289
01:41:41,760 --> 01:41:42,880
good
2290
01:41:42,880 --> 01:41:45,360
now we want to add this plugin
2291
01:41:45,360 --> 01:41:48,480
to our config file so copy the relative
2292
01:41:48,480 --> 01:41:50,000
path
2293
01:41:50,000 --> 01:41:52,239
go here
2294
01:41:52,239 --> 01:41:53,679
and paste it in
2295
01:41:53,679 --> 01:41:56,159
that's it
2296
01:41:57,600 --> 01:42:01,040
let's restart in the servo
2297
01:42:01,040 --> 01:42:02,880
and let's check chrome to see if we have
2298
01:42:02,880 --> 01:42:04,880
any errors as soon as this
2299
01:42:04,880 --> 01:42:07,880
finishes
2300
01:42:08,560 --> 01:42:11,880
all right good
2301
01:42:14,480 --> 01:42:18,320
just refresh no errors so far
2302
01:42:19,760 --> 01:42:22,719
no error so far
2303
01:42:24,800 --> 01:42:25,920
all right
2304
01:42:25,920 --> 01:42:27,280
so
2305
01:42:27,280 --> 01:42:30,639
let's jump back to vs code
2306
01:42:34,080 --> 01:42:36,639
now let's close the terminal and we want
2307
01:42:36,639 --> 01:42:38,320
to use this
2308
01:42:38,320 --> 01:42:40,000
form of money
2309
01:42:40,000 --> 01:42:41,119
function
2310
01:42:41,119 --> 01:42:43,040
on the different places where we're
2311
01:42:43,040 --> 01:42:44,320
displaying the
2312
01:42:44,320 --> 01:42:47,520
price of the um products
2313
01:42:47,520 --> 01:42:49,360
so in components let's go to the
2314
01:42:49,360 --> 01:42:52,960
carousel we have it here
2315
01:42:52,960 --> 01:42:55,440
and how you use this is dollar sign the
2316
01:42:55,440 --> 01:42:58,000
name of the function
2317
01:42:58,000 --> 01:43:00,719
and the parameter which is going to be
2318
01:43:00,719 --> 01:43:03,199
the price
2319
01:43:04,239 --> 01:43:06,960
see if we should save that
2320
01:43:06,960 --> 01:43:08,960
let's go to
2321
01:43:08,960 --> 01:43:10,880
product slider
2322
01:43:10,880 --> 01:43:14,239
using the price here as well
2323
01:43:20,239 --> 01:43:22,800
and
2324
01:43:23,520 --> 01:43:25,119
let's go
2325
01:43:25,119 --> 01:43:28,080
to our
2326
01:43:28,080 --> 01:43:30,880
products page
2327
01:43:31,199 --> 01:43:33,040
showing the price here as well let's
2328
01:43:33,040 --> 01:43:35,600
remove this
2329
01:43:36,560 --> 01:43:39,840
final price
2330
01:43:41,199 --> 01:43:43,119
and i don't think this card is actually
2331
01:43:43,119 --> 01:43:44,800
redirecting nicely
2332
01:43:44,800 --> 01:43:48,320
so let's change this to
2333
01:43:49,040 --> 01:43:53,239
products slash
2334
01:43:56,800 --> 01:43:59,840
let's go back to chrome
2335
01:44:00,000 --> 01:44:01,119
check it out
2336
01:44:01,119 --> 01:44:02,080
yep
2337
01:44:02,080 --> 01:44:05,520
prices are being formatted correctly
2338
01:44:05,520 --> 01:44:06,800
here
2339
01:44:06,800 --> 01:44:08,880
here
2340
01:44:08,880 --> 01:44:11,520
here as well
2341
01:44:14,080 --> 01:44:16,320
good
2342
01:44:17,119 --> 01:44:19,600
all right so now that we
2343
01:44:19,600 --> 01:44:20,719
have the
2344
01:44:20,719 --> 01:44:22,719
functions in place
2345
01:44:22,719 --> 01:44:24,159
let's
2346
01:44:24,159 --> 01:44:25,280
uh
2347
01:44:25,280 --> 01:44:28,639
add the add to cart um function on the
2348
01:44:28,639 --> 01:44:31,520
product details page
2349
01:44:31,520 --> 01:44:32,400
so
2350
01:44:32,400 --> 01:44:36,000
let's go back to vs code
2351
01:44:38,480 --> 01:44:39,970
and for
2352
01:44:39,970 --> 01:44:41,920
[Music]
2353
01:44:41,920 --> 01:44:42,719
the
2354
01:44:42,719 --> 01:44:45,119
product details page whenever the user
2355
01:44:45,119 --> 01:44:46,840
clicks on the up to
2356
01:44:46,840 --> 01:44:49,600
cardboard we want
2357
01:44:49,600 --> 01:44:53,040
to trigger that um mutation so let's go
2358
01:44:53,040 --> 01:44:54,320
click
2359
01:44:54,320 --> 01:44:57,840
and we want to call store
2360
01:44:57,840 --> 01:45:00,320
commit
2361
01:45:01,040 --> 01:45:02,560
also carts
2362
01:45:02,560 --> 01:45:04,880
namespace and we want to call the
2363
01:45:04,880 --> 01:45:06,719
optical mutation
2364
01:45:06,719 --> 01:45:07,840
so
2365
01:45:07,840 --> 01:45:10,560
add to cart
2366
01:45:11,600 --> 01:45:15,679
and then we pass them the product
2367
01:45:15,679 --> 01:45:18,560
which is this product down here
2368
01:45:18,560 --> 01:45:20,480
so let's just save that
2369
01:45:20,480 --> 01:45:22,239
and see if it's actually
2370
01:45:22,239 --> 01:45:24,639
doing anything
2371
01:45:24,639 --> 01:45:28,080
so jump back to chrome
2372
01:45:28,320 --> 01:45:31,840
let's click this and
2373
01:45:31,840 --> 01:45:34,960
it works you see the add to cart um
2374
01:45:34,960 --> 01:45:37,679
thing here and if we inspect
2375
01:45:37,679 --> 01:45:40,320
ux
2376
01:45:43,600 --> 01:45:45,600
there's one item in our cart
2377
01:45:45,600 --> 01:45:47,520
and if we click this
2378
01:45:47,520 --> 01:45:49,119
cart updated
2379
01:45:49,119 --> 01:45:52,159
the quantity increases
2380
01:45:52,719 --> 01:45:54,239
all right good
2381
01:45:54,239 --> 01:45:57,119
uh let's see if it's being stored in or
2382
01:45:57,119 --> 01:46:02,000
local storage free card yes it is
2383
01:46:03,280 --> 01:46:05,199
all right good
2384
01:46:05,199 --> 01:46:08,480
so now we want to update this
2385
01:46:08,480 --> 01:46:11,440
card icon if the user has
2386
01:46:11,440 --> 01:46:13,280
an item in the card
2387
01:46:13,280 --> 01:46:16,960
so let's jump up to vs code
2388
01:46:20,400 --> 01:46:25,000
and we want to go to the nav component
2389
01:46:26,320 --> 01:46:28,800
down to the
2390
01:46:28,800 --> 01:46:30,880
cardboard
2391
01:46:30,880 --> 01:46:32,080
all right so
2392
01:46:32,080 --> 01:46:34,239
what we will do for this
2393
01:46:34,239 --> 01:46:37,840
is we'll display a badge if
2394
01:46:37,840 --> 01:46:40,960
there is an item
2395
01:46:40,960 --> 01:46:43,199
in this in the
2396
01:46:43,199 --> 01:46:44,719
cart for the user
2397
01:46:44,719 --> 01:46:45,679
so
2398
01:46:45,679 --> 01:46:47,360
let's go we
2399
01:46:47,360 --> 01:46:49,760
watch
2400
01:46:51,520 --> 01:46:55,199
and we only want to show this badge
2401
01:46:55,199 --> 01:46:57,600
with this store
2402
01:46:57,600 --> 01:46:59,600
by states
2403
01:46:59,600 --> 01:47:01,199
cards
2404
01:47:01,199 --> 01:47:02,800
or cards
2405
01:47:02,800 --> 01:47:04,800
not length
2406
01:47:04,800 --> 01:47:08,679
is less than zero
2407
01:47:11,920 --> 01:47:13,920
if it is
2408
01:47:13,920 --> 01:47:15,040
let's
2409
01:47:15,040 --> 01:47:17,280
show
2410
01:47:17,520 --> 01:47:19,600
this icon
2411
01:47:19,600 --> 01:47:23,119
and if it's not
2412
01:47:23,119 --> 01:47:26,080
then we'll show the empty icon every
2413
01:47:26,080 --> 01:47:28,400
else
2414
01:47:29,679 --> 01:47:33,600
so i want this badge to overlap
2415
01:47:33,600 --> 01:47:36,800
and i want the content
2416
01:47:36,800 --> 01:47:39,199
to be
2417
01:47:39,199 --> 01:47:42,159
uh i don't know what it's going to be
2418
01:47:42,159 --> 01:47:45,040
the number of items in the card so let's
2419
01:47:45,040 --> 01:47:48,920
just carry this over
2420
01:47:50,400 --> 01:47:52,960
hit save
2421
01:47:52,960 --> 01:47:56,560
let's jump back to chrome
2422
01:47:58,080 --> 01:48:00,639
refresh
2423
01:48:00,719 --> 01:48:03,520
and you can see the number here
2424
01:48:03,520 --> 01:48:05,840
so we have one item in our card
2425
01:48:05,840 --> 01:48:07,440
let's try adding something else let's
2426
01:48:07,440 --> 01:48:10,639
add this headphone
2427
01:48:10,639 --> 01:48:14,080
so we'll get the notification and then
2428
01:48:14,080 --> 01:48:15,600
two items
2429
01:48:15,600 --> 01:48:18,960
now this uh icon button should
2430
01:48:18,960 --> 01:48:21,520
be switching the theme of our
2431
01:48:21,520 --> 01:48:23,920
application from light to dark so let's
2432
01:48:23,920 --> 01:48:27,119
let's implement that alone
2433
01:48:27,840 --> 01:48:31,199
so in our nav
2434
01:48:31,360 --> 01:48:33,840
component
2435
01:48:36,080 --> 01:48:39,920
we'll just call a function on this
2436
01:48:39,920 --> 01:48:41,520
button when it's clicked
2437
01:48:41,520 --> 01:48:45,560
let's call it toggle theme
2438
01:48:51,280 --> 01:48:55,000
just copies here
2439
01:49:00,400 --> 01:49:01,840
when this
2440
01:49:01,840 --> 01:49:04,000
method is called we just want to change
2441
01:49:04,000 --> 01:49:05,280
the
2442
01:49:05,280 --> 01:49:07,679
beautify
2443
01:49:07,679 --> 01:49:10,159
theme
2444
01:49:10,239 --> 01:49:12,159
to the opposite of what it is so it's
2445
01:49:12,159 --> 01:49:15,840
going to be the opposite
2446
01:49:17,119 --> 01:49:19,119
of what it is
2447
01:49:19,119 --> 01:49:20,960
so let's save that and see if it's
2448
01:49:20,960 --> 01:49:23,360
happening
2449
01:49:26,239 --> 01:49:29,560
and it works
2450
01:49:32,080 --> 01:49:35,199
now of course if you uh refresh the page
2451
01:49:35,199 --> 01:49:37,679
we'll go back to the live theme
2452
01:49:37,679 --> 01:49:39,760
uh you can actually process this if you
2453
01:49:39,760 --> 01:49:41,520
want in local storage
2454
01:49:41,520 --> 01:49:44,960
but i'm not going to do that here
2455
01:49:45,360 --> 01:49:49,199
but it works as it should
2456
01:49:49,280 --> 01:49:50,560
next thing that we want to do is to
2457
01:49:50,560 --> 01:49:52,960
implement our card page
2458
01:49:52,960 --> 01:49:57,080
so let's jump back to vs code
2459
01:50:00,639 --> 01:50:02,800
and we want to create
2460
01:50:02,800 --> 01:50:04,320
a folder
2461
01:50:04,320 --> 01:50:06,480
called
2462
01:50:06,480 --> 01:50:09,480
cart
2463
01:50:18,880 --> 01:50:21,280
now in this cart page we want to show
2464
01:50:21,280 --> 01:50:24,000
our navbar
2465
01:50:28,560 --> 01:50:32,480
and whenever we click on the cart icon
2466
01:50:32,480 --> 01:50:34,159
we should be taken to
2467
01:50:34,159 --> 01:50:36,159
this page
2468
01:50:36,159 --> 01:50:37,440
so
2469
01:50:37,440 --> 01:50:40,480
let's just add it here
2470
01:50:40,800 --> 01:50:44,679
and down here
2471
01:50:54,560 --> 01:50:55,280
now
2472
01:50:55,280 --> 01:50:57,760
if we have no items in our
2473
01:50:57,760 --> 01:50:59,280
cart
2474
01:50:59,280 --> 01:51:02,480
we want to let the user know that hey
2475
01:51:02,480 --> 01:51:03,760
nothing is here
2476
01:51:03,760 --> 01:51:05,040
um
2477
01:51:05,040 --> 01:51:07,760
you can actually add some items to
2478
01:51:07,760 --> 01:51:08,880
continue
2479
01:51:08,880 --> 01:51:10,719
so
2480
01:51:10,719 --> 01:51:12,239
let's just
2481
01:51:12,239 --> 01:51:15,280
add some styling to this div
2482
01:51:15,280 --> 01:51:18,239
and add the message
2483
01:51:18,719 --> 01:51:21,840
just yet
2484
01:51:22,639 --> 01:51:25,280
keep shopping
2485
01:51:26,000 --> 01:51:27,599
save that
2486
01:51:27,599 --> 01:51:31,920
and this should only be the case if
2487
01:51:31,920 --> 01:51:35,199
like i said earlier we have no items in
2488
01:51:35,199 --> 01:51:38,159
our card so vf
2489
01:51:38,159 --> 01:51:39,199
score
2490
01:51:39,199 --> 01:51:40,880
state
2491
01:51:40,880 --> 01:51:41,840
card
2492
01:51:41,840 --> 01:51:44,480
black card
2493
01:51:46,080 --> 01:51:49,719
is equal to zero
2494
01:51:50,800 --> 01:51:52,320
and why are we getting this error
2495
01:51:52,320 --> 01:51:54,719
message
2496
01:51:54,880 --> 01:51:56,719
we always v
2497
01:51:56,719 --> 01:51:59,840
four should be if
2498
01:51:59,840 --> 01:52:03,520
and our charging over anything
2499
01:52:03,520 --> 01:52:06,800
and then we will have a container
2500
01:52:06,800 --> 01:52:09,199
with the different products that are in
2501
01:52:09,199 --> 01:52:11,599
our cart
2502
01:52:13,840 --> 01:52:15,599
so
2503
01:52:15,599 --> 01:52:20,800
the container and we want a row
2504
01:52:22,719 --> 01:52:25,280
and we're going to loop over the items
2505
01:52:25,280 --> 01:52:28,159
in our cart
2506
01:52:29,520 --> 01:52:32,480
what i keep doing that
2507
01:52:38,400 --> 01:52:43,880
we want items in our car so
2508
01:52:47,920 --> 01:52:49,440
and i'm just going to copy and paste the
2509
01:52:49,440 --> 01:52:54,239
code here and then we can explain it as
2510
01:52:54,239 --> 01:52:57,880
i go along
2511
01:53:01,840 --> 01:53:05,360
all right so here we have a
2512
01:53:05,360 --> 01:53:08,000
column with a card inside
2513
01:53:08,000 --> 01:53:10,320
it's flat and the
2514
01:53:10,320 --> 01:53:12,480
column is going to be surface
2515
01:53:12,480 --> 01:53:14,960
we have a button at the top
2516
01:53:14,960 --> 01:53:17,920
with a delete icon inside and this will
2517
01:53:17,920 --> 01:53:19,199
remove
2518
01:53:19,199 --> 01:53:21,840
the item from the card as you can see
2519
01:53:21,840 --> 01:53:24,480
it's calling the remove card item that
2520
01:53:24,480 --> 01:53:28,000
we created in mutations earlier
2521
01:53:28,000 --> 01:53:29,199
which is
2522
01:53:29,199 --> 01:53:30,400
this
2523
01:53:30,400 --> 01:53:32,159
so you just pass in the index and it
2524
01:53:32,159 --> 01:53:34,960
will remove the item from the card the
2525
01:53:34,960 --> 01:53:37,599
index in this case will be i
2526
01:53:37,599 --> 01:53:42,159
uh next we have another row
2527
01:53:42,159 --> 01:53:44,159
which will help us to lay out the items
2528
01:53:44,159 --> 01:53:45,599
on our card
2529
01:53:45,599 --> 01:53:47,040
so you see we have the product image
2530
01:53:47,040 --> 01:53:48,560
here
2531
01:53:48,560 --> 01:53:51,599
with a height of 220 we have the name of
2532
01:53:51,599 --> 01:53:52,880
the product
2533
01:53:52,880 --> 01:53:55,119
followed by the
2534
01:53:55,119 --> 01:53:57,119
quantity
2535
01:53:57,119 --> 01:53:59,360
and we also have
2536
01:53:59,360 --> 01:54:01,520
the price
2537
01:54:01,520 --> 01:54:04,239
of the product here
2538
01:54:04,239 --> 01:54:08,000
and this is multiplied by the quantity
2539
01:54:08,000 --> 01:54:10,320
we also have
2540
01:54:10,320 --> 01:54:13,440
another icon button that will increase
2541
01:54:13,440 --> 01:54:14,880
the number
2542
01:54:14,880 --> 01:54:16,960
the quantity for this item
2543
01:54:16,960 --> 01:54:19,280
and a minus one
2544
01:54:19,280 --> 01:54:21,679
that will decrease the quantity and
2545
01:54:21,679 --> 01:54:24,159
between the two buttons we're displaying
2546
01:54:24,159 --> 01:54:25,119
the
2547
01:54:25,119 --> 01:54:27,920
quantity count
2548
01:54:27,920 --> 01:54:30,320
uh the only thing left to add to this
2549
01:54:30,320 --> 01:54:32,480
is the
2550
01:54:32,480 --> 01:54:34,719
footer component on the scroll to top
2551
01:54:34,719 --> 01:54:38,880
component so let's just add them here
2552
01:54:41,760 --> 01:54:43,679
and let's check chrome to see
2553
01:54:43,679 --> 01:54:46,400
if it's working
2554
01:54:47,599 --> 01:54:51,199
so if i click on cart
2555
01:54:51,199 --> 01:54:53,440
here we go we have
2556
01:54:53,440 --> 01:54:55,679
these items in the cart and if i click
2557
01:54:55,679 --> 01:54:57,840
on the plus one it increases the
2558
01:54:57,840 --> 01:55:00,560
quantity and the price
2559
01:55:00,560 --> 01:55:02,400
decrease
2560
01:55:02,400 --> 01:55:05,760
and if we should go below one try to
2561
01:55:05,760 --> 01:55:07,840
decrease after one it will remove the
2562
01:55:07,840 --> 01:55:10,639
item from the card completely
2563
01:55:10,639 --> 01:55:13,040
you can also explicitly remove them
2564
01:55:13,040 --> 01:55:14,800
like this
2565
01:55:14,800 --> 01:55:17,280
and you can see the the message here no
2566
01:55:17,280 --> 01:55:18,480
items
2567
01:55:18,480 --> 01:55:21,199
yet keep shopping
2568
01:55:21,199 --> 01:55:23,360
and of course the
2569
01:55:23,360 --> 01:55:26,960
badge is no longer being displayed
2570
01:55:27,520 --> 01:55:29,280
so let's go back to our products page
2571
01:55:29,280 --> 01:55:33,000
and add a few more products
2572
01:55:39,040 --> 01:55:41,119
then we can go to our cart page and we
2573
01:55:41,119 --> 01:55:42,719
see them here
2574
01:55:42,719 --> 01:55:44,639
so once you're on our cart page the next
2575
01:55:44,639 --> 01:55:46,400
thing that we want to do is we want to
2576
01:55:46,400 --> 01:55:48,400
proceed to checkout so let's add that
2577
01:55:48,400 --> 01:55:50,560
checkout button up here
2578
01:55:50,560 --> 01:55:53,920
so let's jump back to ps code
2579
01:55:57,440 --> 01:56:01,360
and right above or roll
2580
01:56:01,360 --> 01:56:04,560
we want to add that button
2581
01:56:04,560 --> 01:56:06,800
so
2582
01:56:07,360 --> 01:56:10,639
it's just going to be
2583
01:56:12,159 --> 01:56:13,520
this one
2584
01:56:13,520 --> 01:56:15,840
and what's happening is we're checking
2585
01:56:15,840 --> 01:56:18,159
if we have more than
2586
01:56:18,159 --> 01:56:20,320
one item in our cart
2587
01:56:20,320 --> 01:56:22,239
before displaying this button
2588
01:56:22,239 --> 01:56:23,920
and what this button will do when
2589
01:56:23,920 --> 01:56:26,080
clicked is it will move on to the
2590
01:56:26,080 --> 01:56:28,719
confirm page which we will be creating
2591
01:56:28,719 --> 01:56:29,760
no
2592
01:56:29,760 --> 01:56:32,080
so inside cart let's create a new file
2593
01:56:32,080 --> 01:56:35,920
called confirm above view
2594
01:56:38,800 --> 01:56:42,480
and of course we want to add or
2595
01:56:42,480 --> 01:56:44,080
navigation bar
2596
01:56:44,080 --> 01:56:46,560
in here
2597
01:56:46,560 --> 01:56:48,719
so let's save this file and go to the
2598
01:56:48,719 --> 01:56:51,520
confirm file
2599
01:56:52,159 --> 01:56:55,360
and inside confirm we want to display
2600
01:56:55,360 --> 01:56:57,119
this message as well
2601
01:56:57,119 --> 01:56:59,760
if there are no items in the card
2602
01:56:59,760 --> 01:57:01,599
and the user somehow
2603
01:57:01,599 --> 01:57:05,119
navigates to this page
2604
01:57:07,040 --> 01:57:10,159
let's just add that here
2605
01:57:11,199 --> 01:57:14,000
we also want the option of confirming
2606
01:57:14,000 --> 01:57:16,320
once you've entered all the necessary
2607
01:57:16,320 --> 01:57:18,320
information in the different fields
2608
01:57:18,320 --> 01:57:20,239
and you want option of going back so
2609
01:57:20,239 --> 01:57:24,159
let's just add that here as well
2610
01:57:24,159 --> 01:57:26,480
this container
2611
01:57:26,480 --> 01:57:28,000
so
2612
01:57:28,000 --> 01:57:31,599
let me just paste these buttons in
2613
01:57:35,040 --> 01:57:37,199
so this button will
2614
01:57:37,199 --> 01:57:39,119
take us back
2615
01:57:39,119 --> 01:57:41,360
to the card page and this one will
2616
01:57:41,360 --> 01:57:43,599
complete the order by calling this
2617
01:57:43,599 --> 01:57:45,119
process function
2618
01:57:45,119 --> 01:57:49,400
which we haven't implemented yet
2619
01:57:52,000 --> 01:57:53,199
inside
2620
01:57:53,199 --> 01:57:56,800
the container we want to create
2621
01:57:56,800 --> 01:57:58,159
two forms
2622
01:57:58,159 --> 01:58:00,000
that will allow us to accept user
2623
01:58:00,000 --> 01:58:01,360
information
2624
01:58:01,360 --> 01:58:03,920
so instead of typing everything out let
2625
01:58:03,920 --> 01:58:04,639
me
2626
01:58:04,639 --> 01:58:06,400
just
2627
01:58:06,400 --> 01:58:08,639
copy the form oval
2628
01:58:08,639 --> 01:58:11,760
that's a pretty long form
2629
01:58:13,199 --> 01:58:15,599
so to briefly explain what's happening
2630
01:58:15,599 --> 01:58:19,440
um we're using the v form components
2631
01:58:19,440 --> 01:58:21,440
and we have added a ref
2632
01:58:21,440 --> 01:58:24,639
a form to it and added a class of margin
2633
01:58:24,639 --> 01:58:26,639
top
2634
01:58:26,639 --> 01:58:28,800
a little label at the top of the form to
2635
01:58:28,800 --> 01:58:30,800
see what we're collecting here
2636
01:58:30,800 --> 01:58:33,280
and of course we have
2637
01:58:33,280 --> 01:58:34,960
email
2638
01:58:34,960 --> 01:58:36,960
name phone
2639
01:58:36,960 --> 01:58:38,159
address
2640
01:58:38,159 --> 01:58:39,360
city
2641
01:58:39,360 --> 01:58:40,960
country
2642
01:58:40,960 --> 01:58:45,119
and some credit card information here
2643
01:58:45,119 --> 01:58:46,960
let's create these properties let me
2644
01:58:46,960 --> 01:58:49,840
just copy them over
2645
01:58:54,960 --> 01:58:56,239
so we
2646
01:58:56,239 --> 01:58:58,880
added added a dummy credit card here
2647
01:58:58,880 --> 01:59:03,639
with an expiration date and cpv
2648
01:59:04,320 --> 01:59:05,520
and then
2649
01:59:05,520 --> 01:59:07,199
we want to create
2650
01:59:07,199 --> 01:59:09,199
the
2651
01:59:09,199 --> 01:59:10,239
rules
2652
01:59:10,239 --> 01:59:11,440
for
2653
01:59:11,440 --> 01:59:13,679
um
2654
01:59:14,320 --> 01:59:16,719
for the different input fields
2655
01:59:16,719 --> 01:59:17,760
now
2656
01:59:17,760 --> 01:59:20,800
what i'm going to do is
2657
01:59:20,800 --> 01:59:25,199
create a property called rules
2658
01:59:25,199 --> 01:59:28,199
here
2659
01:59:30,239 --> 01:59:34,239
and rules will be
2660
01:59:34,719 --> 01:59:37,280
an object not an array
2661
01:59:37,280 --> 01:59:39,599
with different functions
2662
01:59:39,599 --> 01:59:40,560
now
2663
01:59:40,560 --> 01:59:41,760
the
2664
01:59:41,760 --> 01:59:45,400
required function
2665
01:59:46,960 --> 01:59:51,199
is going to accept a value
2666
01:59:51,599 --> 01:59:54,239
and it's going to
2667
01:59:54,239 --> 01:59:57,199
return true
2668
01:59:57,440 --> 02:00:00,719
if value is truthy
2669
02:00:00,719 --> 02:00:02,480
and
2670
02:00:02,480 --> 02:00:04,239
if it's not it's going to return this
2671
02:00:04,239 --> 02:00:07,760
text call required
2672
02:00:09,920 --> 02:00:13,719
so let's save this
2673
02:00:14,239 --> 02:00:16,639
and the second rule that we want to add
2674
02:00:16,639 --> 02:00:20,719
is this email rule
2675
02:00:22,480 --> 02:00:26,119
it's going to be a function
2676
02:00:27,520 --> 02:00:31,679
that takes in a value as well
2677
02:00:33,280 --> 02:00:36,080
and inside this function we're going to
2678
02:00:36,080 --> 02:00:38,880
get our regular expression
2679
02:00:38,880 --> 02:00:41,840
so let's call this
2680
02:00:41,840 --> 02:00:44,400
pattern
2681
02:00:46,960 --> 02:00:50,080
and we're going to set it to
2682
02:00:50,080 --> 02:00:54,280
this regular expression
2683
02:00:54,400 --> 02:00:57,119
provided it in an email
2684
02:00:57,119 --> 02:01:00,400
and then we're going to return
2685
02:01:01,280 --> 02:01:03,360
pattern
2686
02:01:03,360 --> 02:01:05,440
not test
2687
02:01:05,440 --> 02:01:08,560
the value that was passed in and if it
2688
02:01:08,560 --> 02:01:09,840
fails
2689
02:01:09,840 --> 02:01:12,480
then we just return a string that says
2690
02:01:12,480 --> 02:01:15,360
invalid email
2691
02:01:20,719 --> 02:01:22,239
now let's see if all of this is working
2692
02:01:22,239 --> 02:01:25,440
let's jump back to chrome
2693
02:01:27,280 --> 02:01:29,280
we have our checkout button to refresh
2694
02:01:29,280 --> 02:01:32,400
the page and if we go to checkout
2695
02:01:32,400 --> 02:01:33,440
and
2696
02:01:33,440 --> 02:01:36,440
yep
2697
02:01:37,599 --> 02:01:39,040
rules are working
2698
02:01:39,040 --> 02:01:40,239
should be able to go back with this
2699
02:01:40,239 --> 02:01:41,119
button
2700
02:01:41,119 --> 02:01:43,119
go forward this one
2701
02:01:43,119 --> 02:01:44,800
good
2702
02:01:44,800 --> 02:01:46,880
now we want to implement the
2703
02:01:46,880 --> 02:01:48,159
complete
2704
02:01:48,159 --> 02:01:50,880
uh function the process function
2705
02:01:50,880 --> 02:01:53,520
so when the user enters the information
2706
02:01:53,520 --> 02:01:54,800
here
2707
02:01:54,800 --> 02:01:57,280
we can process their order
2708
02:01:57,280 --> 02:02:01,480
so let's jump back to vs code
2709
02:02:06,000 --> 02:02:10,719
and we're going to go to methods
2710
02:02:11,520 --> 02:02:14,719
and process
2711
02:02:15,920 --> 02:02:19,560
just make this a synchronous
2712
02:02:29,360 --> 02:02:32,960
and the only thing that we'll be doing
2713
02:02:32,960 --> 02:02:36,719
is just checking if the form is valid
2714
02:02:36,719 --> 02:02:38,400
so we said this
2715
02:02:38,400 --> 02:02:41,040
also refs
2716
02:02:41,040 --> 02:02:41,840
form
2717
02:02:41,840 --> 02:02:42,960
and
2718
02:02:42,960 --> 02:02:45,440
form is coming from
2719
02:02:45,440 --> 02:02:48,159
this right here
2720
02:02:48,960 --> 02:02:50,800
and we're going to call them validate
2721
02:02:50,800 --> 02:02:53,280
method
2722
02:02:53,360 --> 02:02:56,639
so if it's not valid
2723
02:02:56,719 --> 02:02:58,239
then
2724
02:02:58,239 --> 02:03:01,800
we'll just do nothing
2725
02:03:01,920 --> 02:03:05,040
if it is valid we're just going to
2726
02:03:05,040 --> 02:03:06,880
notify the user
2727
02:03:06,880 --> 02:03:09,840
with a sweet alert pop-up so let me just
2728
02:03:09,840 --> 02:03:12,320
copy and paste this over
2729
02:03:12,320 --> 02:03:14,719
so we're going to wait on this to run
2730
02:03:14,719 --> 02:03:16,880
for three seconds we're just going to
2731
02:03:16,880 --> 02:03:18,880
say processing order we're going to show
2732
02:03:18,880 --> 02:03:20,480
the info icon
2733
02:03:20,480 --> 02:03:22,239
we're not going to allow the user to
2734
02:03:22,239 --> 02:03:24,239
close a dialog
2735
02:03:24,239 --> 02:03:27,760
and the text is going to be please wait
2736
02:03:27,760 --> 02:03:29,920
once this three seconds
2737
02:03:29,920 --> 02:03:32,080
um has passed then we're going to show a
2738
02:03:32,080 --> 02:03:34,080
second dialogue
2739
02:03:34,080 --> 02:03:36,080
and the second dialogue is going to say
2740
02:03:36,080 --> 02:03:38,400
hey your order your order is complete
2741
02:03:38,400 --> 02:03:40,159
and thank you so much
2742
02:03:40,159 --> 02:03:41,280
and
2743
02:03:41,280 --> 02:03:43,679
it's going to run for four seconds
2744
02:03:43,679 --> 02:03:45,599
and then we're going to remove the items
2745
02:03:45,599 --> 02:03:48,400
from the cart that our user just ordered
2746
02:03:48,400 --> 02:03:49,360
and
2747
02:03:49,360 --> 02:03:51,199
go to the home screen
2748
02:03:51,199 --> 02:03:53,199
so we're going to call the clearpath
2749
02:03:53,199 --> 02:03:54,560
method
2750
02:03:54,560 --> 02:03:57,440
from the mutations
2751
02:03:57,440 --> 02:03:58,639
then
2752
02:03:58,639 --> 02:04:00,800
push the home screen
2753
02:04:00,800 --> 02:04:03,280
so let's save this and see if it works
2754
02:04:03,280 --> 02:04:06,400
let's jump back to chrome
2755
02:04:09,280 --> 02:04:11,360
if we try to complete this
2756
02:04:11,360 --> 02:04:13,360
of course it asks you to enter some
2757
02:04:13,360 --> 02:04:16,400
valid information
2758
02:04:16,480 --> 02:04:19,119
and if you enter some valid information
2759
02:04:19,119 --> 02:04:20,960
and click complete then it says please
2760
02:04:20,960 --> 02:04:22,079
wait
2761
02:04:22,079 --> 02:04:25,840
you can click outside
2762
02:04:26,800 --> 02:04:28,239
and then it takes you back to the home
2763
02:04:28,239 --> 02:04:30,639
screen clears the card
2764
02:04:30,639 --> 02:04:33,360
no items
2765
02:04:36,480 --> 02:04:39,760
all right i think that's it um
2766
02:04:39,760 --> 02:04:42,000
i think the the source code for this
2767
02:04:42,000 --> 02:04:43,840
thing will be in the description so you
2768
02:04:43,840 --> 02:04:45,520
can check it out if you need to copy and
2769
02:04:45,520 --> 02:04:46,800
paste anything
2770
02:04:46,800 --> 02:04:48,480
or if you just want to download it and
2771
02:04:48,480 --> 02:04:50,560
play around with it modified yeah that's
2772
02:04:50,560 --> 02:04:53,119
up to you oh yeah
2773
02:04:53,119 --> 02:04:54,639
that's just
2774
02:04:54,639 --> 02:04:55,920
that's how you create an e-commerce
2775
02:04:55,920 --> 02:04:58,560
store linux beautify and
2776
02:04:58,560 --> 02:05:02,079
some images from pixels
160708
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.