Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,210 --> 00:00:04,490
So were you successful?
2
00:00:04,490 --> 00:00:06,090
If you didn't try it on your own,
3
00:00:06,090 --> 00:00:08,580
definitely consider trying it on your own,
4
00:00:08,580 --> 00:00:10,050
practicing what you learned
5
00:00:10,050 --> 00:00:13,100
is an important aspect of learning React.
6
00:00:13,100 --> 00:00:14,450
Either way, we're now going
7
00:00:14,450 --> 00:00:17,280
to implement these features together
8
00:00:17,280 --> 00:00:20,980
and I will actually start with fetching the meals data,
9
00:00:20,980 --> 00:00:24,210
even though that's the bottom most point here,
10
00:00:24,210 --> 00:00:27,256
but it will start with that because I think it makes sense
11
00:00:27,256 --> 00:00:30,179
that we are able to load that data
12
00:00:30,179 --> 00:00:32,433
from a server, from a backend.
13
00:00:33,310 --> 00:00:36,960
For this in the Firebase Realtime Database console,
14
00:00:36,960 --> 00:00:41,957
I'll add a new node manually and I will name it, meals,
15
00:00:43,370 --> 00:00:45,860
and then click this plus again here,
16
00:00:45,860 --> 00:00:48,033
to add some nested data.
17
00:00:49,470 --> 00:00:53,930
And then I just want to add my meals data to Firebase here.
18
00:00:53,930 --> 00:00:58,930
Now for this, I'll start by giving every meal an ID here.
19
00:00:59,190 --> 00:01:02,320
So I'll just use m1 as a key.
20
00:01:02,320 --> 00:01:04,530
And then the value for that will be
21
00:01:04,530 --> 00:01:07,160
the nested data for that meal.
22
00:01:07,160 --> 00:01:09,010
With that, I'm kind of replicating
23
00:01:09,010 --> 00:01:13,340
that Firebase data structure we saw in the Http section
24
00:01:13,340 --> 00:01:15,423
for the dummy data I got here.
25
00:01:16,270 --> 00:01:19,590
So for the meal with the ID m1,
26
00:01:19,590 --> 00:01:21,340
I want to have a name field,
27
00:01:21,340 --> 00:01:22,920
and the value of Sushi,
28
00:01:22,920 --> 00:01:25,150
a description field with this value,
29
00:01:25,150 --> 00:01:27,643
and a price field with this value.
30
00:01:28,690 --> 00:01:31,820
So let's start with the name field here,
31
00:01:31,820 --> 00:01:35,263
and enter sushi as a value, and click add.
32
00:01:36,560 --> 00:01:38,890
And now this entry was added.
33
00:01:38,890 --> 00:01:42,230
Now we can add more nested data to this m1 meal
34
00:01:42,230 --> 00:01:43,760
by clicking this plus,
35
00:01:43,760 --> 00:01:46,250
and adding the description field,
36
00:01:46,250 --> 00:01:50,548
where I then enter a description like this,
37
00:01:50,548 --> 00:01:53,020
and click add,
38
00:01:53,020 --> 00:01:55,140
and add a price field
39
00:01:56,690 --> 00:02:00,380
which is this value, which has this value.
40
00:02:00,380 --> 00:02:02,890
So let's enter that.
41
00:02:02,890 --> 00:02:06,090
Okay, so with that we get the first meal.
42
00:02:06,090 --> 00:02:09,000
Now let's click on the plus here, next to meals,
43
00:02:09,000 --> 00:02:12,930
and let's add a new meal with a different ID, m2,
44
00:02:12,930 --> 00:02:14,830
and then add, click on this plus here
45
00:02:14,830 --> 00:02:18,220
to add the nested data, like the name,
46
00:02:18,220 --> 00:02:22,100
and that will then be schnitzel here in my case,
47
00:02:22,100 --> 00:02:23,390
click add,
48
00:02:23,390 --> 00:02:26,380
and then add the description here,
49
00:02:26,380 --> 00:02:31,380
which has this text here like this,
50
00:02:31,445 --> 00:02:34,940
and let's add the price field
51
00:02:34,940 --> 00:02:38,683
with a value of 16.5.
52
00:02:39,830 --> 00:02:42,253
So now we got the second meal added.
53
00:02:43,110 --> 00:02:44,940
And I'll continue doing that.
54
00:02:44,940 --> 00:02:48,020
You can of course, fast forward here if I'm boring you.
55
00:02:48,020 --> 00:02:50,156
I will now add the third meal
56
00:02:50,156 --> 00:02:55,090
with a name of barbecue burger, like that,
57
00:02:55,090 --> 00:02:55,940
click add,
58
00:02:55,940 --> 00:02:58,963
and then also add the description here,
59
00:03:00,180 --> 00:03:02,853
American raw and meaty,
60
00:03:04,640 --> 00:03:09,400
and also add a price for that third meal here.
61
00:03:09,400 --> 00:03:12,820
So let's add a price field like this.
62
00:03:12,820 --> 00:03:16,830
And now there's only one more meal to go, the green bowl.
63
00:03:16,830 --> 00:03:20,540
For that, I'll add a new meal with an ID of m4,
64
00:03:20,540 --> 00:03:21,680
click the plus,
65
00:03:21,680 --> 00:03:25,170
and for the name field it's now green bowl,
66
00:03:25,170 --> 00:03:28,117
for the description field I will now add
67
00:03:28,117 --> 00:03:29,113
this description here like this,
68
00:03:33,190 --> 00:03:35,030
and then last but not least,
69
00:03:35,030 --> 00:03:39,880
for the price field, it's 18.99.
70
00:03:39,880 --> 00:03:44,880
And with that, all the data is on this Firebase server.
71
00:03:45,298 --> 00:03:47,830
And of course, if we were the owner
72
00:03:47,830 --> 00:03:49,850
of this food delivery service,
73
00:03:49,850 --> 00:03:52,820
we could be administrating the data here.
74
00:03:52,820 --> 00:03:54,520
Now let's work on this front end,
75
00:03:54,520 --> 00:03:57,930
and let's fetch that data from that server.
76
00:03:57,930 --> 00:03:59,560
So here available meals,
77
00:03:59,560 --> 00:04:03,363
I now no longer want to use the dummy meals array.
5787
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.