﻿1
00:00:01,110 --> 00:00:04,230
‫Next up, let's build the static layout

2
00:00:04,230 --> 00:00:06,513
‫of the main application screen.

3
00:00:08,160 --> 00:00:11,760
‫And to start, let's actually take now all

4
00:00:11,760 --> 00:00:15,120
‫of our starter components here and move them

5
00:00:15,120 --> 00:00:17,793
‫into the component folder that we already have.

6
00:00:19,380 --> 00:00:22,023
‫And this can be a bit difficult inside VS Code,

7
00:00:23,130 --> 00:00:24,900
‫so if you find it easier to do

8
00:00:24,900 --> 00:00:29,880
‫in the File Explorer then just go do that there.

9
00:00:29,880 --> 00:00:34,143
‫But anyway, with this, we now no longer need this folder.

10
00:00:35,460 --> 00:00:37,500
‫So let's finally delete that.

11
00:00:37,500 --> 00:00:39,079
‫And with this,

12
00:00:39,079 --> 00:00:41,479
‫we are done handling all of these starter files.

13
00:00:42,630 --> 00:00:45,150
‫So let's close up this one.

14
00:00:45,150 --> 00:00:50,150
‫And now we have, as you see, a lot of different files here.

15
00:00:50,220 --> 00:00:53,370
‫And what some projects do is to create a folder

16
00:00:53,370 --> 00:00:54,903
‫for each of the components.

17
00:00:56,181 --> 00:00:58,920
‫For example, here, this country item,

18
00:00:58,920 --> 00:01:01,230
‫we would create a folder just for this

19
00:01:01,230 --> 00:01:05,100
‫and then place the component itself, the CSS module

20
00:01:05,100 --> 00:01:07,800
‫and maybe even some other files in there.

21
00:01:07,800 --> 00:01:10,620
‫For example, like a test file.

22
00:01:10,620 --> 00:01:13,547
‫But here, let's just keep it simple

23
00:01:13,547 --> 00:01:15,180
‫with a flat file structure,

24
00:01:15,180 --> 00:01:18,183
‫and we will just deal with having all these files here.

25
00:01:19,380 --> 00:01:24,263
‫But anyway, let's now open up our app layout JSX file

26
00:01:24,263 --> 00:01:28,680
‫so that we can now start working on this part.

27
00:01:28,680 --> 00:01:30,900
‫So basically what we want to achieve

28
00:01:30,900 --> 00:01:35,900
‫in the end is to having this sidebar here and this map.

29
00:01:37,230 --> 00:01:38,310
‫All right.

30
00:01:38,310 --> 00:01:40,770
‫And so basically we will now create

31
00:01:40,770 --> 00:01:42,603
‫these two components first.

32
00:01:44,040 --> 00:01:46,953
‫So let's do that here inside our components.

33
00:01:50,610 --> 00:01:52,983
‫So sidebar.JSX.

34
00:01:54,000 --> 00:01:58,807
‫And then also let's immediately do map.JSX.

35
00:02:01,440 --> 00:02:02,940
‫All right.

36
00:02:02,940 --> 00:02:04,830
‫And so starting with the first one,

37
00:02:04,830 --> 00:02:07,620
‫we use again our snippet here.

38
00:02:07,620 --> 00:02:12,090
‫And so then let's start working here on the sidebar.

39
00:02:12,090 --> 00:02:17,090
‫So first of all, this will get the class of sidebar.

40
00:02:17,790 --> 00:02:21,360
‫And so that class is actually inside the module

41
00:02:21,360 --> 00:02:26,070
‫that is already here for this sidebar component.

42
00:02:26,070 --> 00:02:30,480
‫So this class right here.

43
00:02:30,480 --> 00:02:35,480
‫And so let's again start by getting in those styles.

44
00:02:37,500 --> 00:02:39,960
‫And I will actually show you an easier way

45
00:02:39,960 --> 00:02:42,930
‫of importing this a bit later.

46
00:02:42,930 --> 00:02:46,530
‫But for now, let's just keep doing this .CSS.

47
00:02:49,840 --> 00:02:54,550
‫And now we can come here and use styles.sidebar.

48
00:02:57,210 --> 00:03:01,713
‫And now here we want to bring in our logo again,

49
00:03:02,580 --> 00:03:04,953
‫so just as we can see there on the right side.

50
00:03:06,520 --> 00:03:08,133
‫Then we also have the app nav.

51
00:03:09,870 --> 00:03:13,530
‫So that's this component that we also already created.

52
00:03:13,530 --> 00:03:17,430
‫Then we will have that list of cities

53
00:03:17,430 --> 00:03:18,960
‫which we don't have yet.

54
00:03:18,960 --> 00:03:22,203
‫And so for now, let's just write that here.

55
00:03:23,460 --> 00:03:24,810
‫List of cities.

56
00:03:24,810 --> 00:03:27,180
‫And then finally down here,

57
00:03:27,180 --> 00:03:29,343
‫we also have this kind of footer.

58
00:03:31,590 --> 00:03:32,460
‫And for this,

59
00:03:32,460 --> 00:03:36,300
‫let's actually just use the HTML footer element.

60
00:03:36,300 --> 00:03:39,180
‫So without creating a new component,

61
00:03:39,180 --> 00:03:41,910
‫which I guess might make sense

62
00:03:41,910 --> 00:03:45,360
‫but I just wanted to keep our list of components here

63
00:03:45,360 --> 00:03:46,473
‫a little bit shorter.

64
00:03:47,310 --> 00:03:51,450
‫So if you want, you can totally as an exercise do that.

65
00:03:51,450 --> 00:03:53,880
‫So creating a new photo component,

66
00:03:53,880 --> 00:03:56,550
‫and then also exporting these styles

67
00:03:56,550 --> 00:04:00,570
‫that we're going to need here to a new CSS module.

68
00:04:00,570 --> 00:04:04,770
‫So that will be footer.module.CSS.

69
00:04:04,770 --> 00:04:08,730
‫So then taking these two styles into that other module.

70
00:04:08,730 --> 00:04:11,140
‫But again, I will just keep those here

71
00:04:12,000 --> 00:04:13,353
‫to keep it a bit simpler.

72
00:04:19,350 --> 00:04:22,120
‫And now here, let's create a paragraph

73
00:04:24,090 --> 00:04:29,090
‫with styles.copyright, like this.

74
00:04:30,090 --> 00:04:33,740
‫And then let's just do copy, copyright.

75
00:04:37,590 --> 00:04:39,870
‫And then new date,

76
00:04:39,870 --> 00:04:44,820
‫and get full year so that we dynamically calculate

77
00:04:44,820 --> 00:04:47,250
‫the current year here.

78
00:04:47,250 --> 00:04:52,050
‫And then by WorldWise, Inc, let's say,

79
00:04:52,050 --> 00:04:54,480
‫completely made up company.

80
00:04:54,480 --> 00:04:58,470
‫And yeah, I just realized that it would be a lot nicer

81
00:04:58,470 --> 00:05:00,570
‫to have this in its own component.

82
00:05:00,570 --> 00:05:03,330
‫And so as I was saying before, please do that now

83
00:05:03,330 --> 00:05:06,600
‫as a challenge, while I will simply leave it here

84
00:05:06,600 --> 00:05:07,653
‫to keep it simple.

85
00:05:08,940 --> 00:05:13,383
‫Now okay, and now let's remove all of this from here.

86
00:05:14,640 --> 00:05:18,363
‫And let's then include this sidebar that we just built.

87
00:05:20,520 --> 00:05:24,840
‫Okay, and that's looking a lot nicer already.

88
00:05:24,840 --> 00:05:28,170
‫We are just missing some layout here, and that's just

89
00:05:28,170 --> 00:05:31,680
‫because we are still missing our style here.

90
00:05:31,680 --> 00:05:33,720
‫So we need to import that again.

91
00:05:33,720 --> 00:05:35,763
‫But now let me show you an easier way.

92
00:05:36,858 --> 00:05:38,370
‫So using again a snippet.

93
00:05:38,370 --> 00:05:42,000
‫So come here to our index.CSS file

94
00:05:42,000 --> 00:05:45,810
‫where I placed this snippet code for you.

95
00:05:45,810 --> 00:05:48,180
‫So please copy that

96
00:05:48,180 --> 00:05:51,270
‫at least if you want to use this snippet.

97
00:05:51,270 --> 00:05:53,230
‫And then come again to user snippets

98
00:05:54,102 --> 00:05:56,820
‫where we already placed some other ones.

99
00:05:56,820 --> 00:05:59,790
‫So we've been using this one and this one.

100
00:05:59,790 --> 00:06:03,633
‫And so right afterwards, let's paste that code.

101
00:06:05,511 --> 00:06:07,330
‫And so now we will have a snippet

102
00:06:08,472 --> 00:06:11,610
‫which we can use with this prefix of CSM.

103
00:06:11,610 --> 00:06:14,490
‫So that stands for CSS modules.

104
00:06:14,490 --> 00:06:19,490
‫And that will then automatically import those styles for us.

105
00:06:19,770 --> 00:06:24,330
‫So save this, close it, close this one as well.

106
00:06:24,330 --> 00:06:27,510
‫And then use CSM.

107
00:06:27,510 --> 00:06:29,490
‫And there we go.

108
00:06:29,490 --> 00:06:32,850
‫So it automatically uses again the file name here.

109
00:06:32,850 --> 00:06:37,850
‫And so now we can just use the styles object.

110
00:06:40,132 --> 00:06:42,483
‫So styles.app.

111
00:06:43,560 --> 00:06:46,050
‫And beautiful.

112
00:06:46,050 --> 00:06:49,860
‫So now we have our sidebar here on the left side,

113
00:06:49,860 --> 00:06:52,653
‫and on the right side we are going to have that map.

114
00:06:53,580 --> 00:06:57,513
‫And so that's coming here from this flex container.

115
00:06:59,520 --> 00:07:03,333
‫All right, so let's then build this map.

116
00:07:05,760 --> 00:07:08,880
‫And for now here we will just write map,

117
00:07:08,880 --> 00:07:13,880
‫and then also use some more styles.

118
00:07:15,060 --> 00:07:17,073
‫So our snippet CSM,

119
00:07:18,150 --> 00:07:21,273
‫and you see this makes it really a lot faster.

120
00:07:22,140 --> 00:07:25,893
‫So then here it is, map container.

121
00:07:27,390 --> 00:07:31,833
‫And then let's include this right here as well.

122
00:07:34,350 --> 00:07:36,960
‫So map and choosing this one

123
00:07:36,960 --> 00:07:40,710
‫so that it automatically gets included.

124
00:07:40,710 --> 00:07:42,960
‫And nice.

125
00:07:42,960 --> 00:07:44,970
‫So there we have it.

126
00:07:44,970 --> 00:07:48,000
‫And you see that we are not doing any composition

127
00:07:48,000 --> 00:07:49,860
‫here in this case.

128
00:07:49,860 --> 00:07:54,840
‫So our sidebar contains a couple of elements and components

129
00:07:54,840 --> 00:07:57,000
‫which we could have just passed in here

130
00:07:57,000 --> 00:07:59,730
‫as children components in this case.

131
00:07:59,730 --> 00:08:02,160
‫So just like we have been doing before,

132
00:08:02,160 --> 00:08:05,250
‫but since we are not passing any props here anyway,

133
00:08:05,250 --> 00:08:08,190
‫let's just keep this page here very clean.

134
00:08:08,190 --> 00:08:10,170
‫So I usually like to do that.

135
00:08:10,170 --> 00:08:13,200
‫So having the pages without much stuff in them,

136
00:08:13,200 --> 00:08:14,640
‫so that most of the code

137
00:08:14,640 --> 00:08:18,570
‫is actually inside my components folder.

138
00:08:18,570 --> 00:08:19,650
‫So then this page,

139
00:08:19,650 --> 00:08:24,060
‫basically all it does is to just add some styles to the page

140
00:08:24,060 --> 00:08:27,333
‫and then it includes all the components that are necessary.

141
00:08:28,800 --> 00:08:31,740
‫Let's just remove that, that code there.

142
00:08:31,740 --> 00:08:34,230
‫And with this, we are actually finished.

143
00:08:34,230 --> 00:08:37,440
‫And so now with the static layout in place,

144
00:08:37,440 --> 00:08:38,700
‫it's time to go back

145
00:08:38,700 --> 00:08:41,913
‫to learning a bit more about React Router.

