Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,060 --> 00:00:08,070
But let's continue and add some functionality to our menu items since they actually themselves need
2
00:00:08,070 --> 00:00:11,640
to be and links to each service page.
3
00:00:11,640 --> 00:00:20,310
So if we come over we can use the same component prop that we have been using to turn the menu item
4
00:00:20,310 --> 00:00:30,300
into a link that of course means we need the two property and a set that equal to slash custom software
5
00:00:31,370 --> 00:00:39,570
let's go ahead and copy those over for the other tabs and make sure to go in and then change the path
6
00:00:39,870 --> 00:00:43,260
to slash mobile apps.
7
00:00:43,380 --> 00:00:52,970
And then on the last one to slash Web sites for go ahead and save this our page will refresh.
8
00:00:52,970 --> 00:01:00,290
And if we hover over these services tab to see our menu and now we go ahead and select one of our menu
9
00:01:00,320 --> 00:01:07,820
items you see that we have now been taken to the mobile apps page and the mobile apps text is displayed
10
00:01:08,890 --> 00:01:13,280
so we have correctly set up the routing part of this menu.
11
00:01:13,330 --> 00:01:21,790
But I want to show you a little gotcha that comes up here if we come over say to the home page and now
12
00:01:21,790 --> 00:01:28,130
we come over and hover over the services tab and say choose Web site development.
13
00:01:28,130 --> 00:01:35,200
Well if you notice on the screen the home page is still active even though we do have the correct route
14
00:01:35,230 --> 00:01:39,250
in the URL as well as the right content on the screen.
15
00:01:39,280 --> 00:01:45,070
We aren't setting the correct active tab and that's because there's nothing hooked up to any of these
16
00:01:45,070 --> 00:01:52,340
menu items telling it to change the values piece of state which determines are active.
17
00:01:52,360 --> 00:02:02,010
Tab we can go ahead and fix this by coming down to our menu and on each menu item where we have the
18
00:02:02,010 --> 00:02:06,180
on click property and we're calling our handle close.
19
00:02:06,180 --> 00:02:14,310
We then also need to tell the page to update the state value to make sure that these services tab is
20
00:02:14,310 --> 00:02:23,820
set to active we can set multiple on click functions by actually adding a nother set of brackets in
21
00:02:23,820 --> 00:02:27,870
here and then turning this into an arrow function.
22
00:02:27,870 --> 00:02:36,630
So now this is actually a full expression that we can use to call the handle close function and then
23
00:02:36,690 --> 00:02:46,110
make sure you put in a semicolon and we can now set the value to 1 and that is going to set the value
24
00:02:46,110 --> 00:02:55,160
which is managing our active tab to these services tab index this is a pretty handy piece of syntax
25
00:02:55,160 --> 00:02:59,130
here so be sure to remember it for use on your future projects.
26
00:02:59,240 --> 00:03:06,560
But let's go ahead and copy the insides of this and since it's gonna be the same for all of these menu
27
00:03:06,560 --> 00:03:12,620
items we can go ahead and just select that handle clothes that used to be there and paste it in and
28
00:03:12,620 --> 00:03:14,990
do the same for Web site development.
29
00:03:14,990 --> 00:03:21,200
So now if we go ahead and save the page let's go back to the home screen.
30
00:03:21,200 --> 00:03:27,290
And now if we hover over the services tab and select Web site development you can see that we're on
31
00:03:27,290 --> 00:03:32,690
the Web site page and these services tab is now selected again.
32
00:03:32,710 --> 00:03:37,900
There is still the problem here that we can't actually get to these services page.
33
00:03:37,900 --> 00:03:44,260
It's always going to take us to the custom software page since that's the first menu item but we want
34
00:03:44,260 --> 00:03:51,820
the user to have the ability to go to the slash services route which will display a link to all of the
35
00:03:51,910 --> 00:03:54,340
services at once.
36
00:03:54,510 --> 00:03:58,160
This is just a user friendly architecture for your site.
37
00:03:58,290 --> 00:04:05,750
That just helps provide continuity to people who may otherwise feel more confused so let's actually
38
00:04:05,780 --> 00:04:12,680
go ahead and come over to the menu items and we'll go ahead and fix this.
39
00:04:12,680 --> 00:04:19,370
Now you may be thinking that we could just push the menu down and then we could still leave the services
40
00:04:19,370 --> 00:04:26,360
tab exposed and that was actually the first thing that I tried but it turns out if you do that the services
41
00:04:26,360 --> 00:04:31,850
tab still isn't actually clickable because the menu has taken over the focus.
42
00:04:31,940 --> 00:04:38,000
So if you really wanted a solution like that you would have to go into a more advanced architecture
43
00:04:38,030 --> 00:04:44,090
which is actually what I was talking about in the documentation video that we might do as a bonus video
44
00:04:44,090 --> 00:04:46,180
at the end of the course.
45
00:04:46,280 --> 00:04:53,750
For now though I feel an appropriate solution is to copy one of these menu items and then we can go
46
00:04:53,750 --> 00:05:01,100
ahead and paste it here above the custom software development page and change the link to slash services
47
00:05:01,280 --> 00:05:05,970
and change the text down here of course to services as well.
48
00:05:05,990 --> 00:05:12,770
And now if we save this you'll see that when we now hover over the tab we have an option for services
49
00:05:12,770 --> 00:05:18,060
as well and can now return to these slash services route.
50
00:05:18,100 --> 00:05:19,930
I think that this looks okay.
51
00:05:19,960 --> 00:05:23,500
And once we get it styled It'll actually look even better.
6111
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.