1
00:00:00,060 --> 00:00:05,490
We are going to create a method that is going to help us to copy our data when we click on the global

2
00:00:05,490 --> 00:00:05,880
icon.

3
00:00:06,180 --> 00:00:12,750
But for that, we also need another hook from our React module and that is the use Redbook.

4
00:00:13,590 --> 00:00:15,770
So just imported, inventive imported.

5
00:00:15,770 --> 00:00:23,310
If we are going to create another constant and that's name it, copy button, which is going to use

6
00:00:23,520 --> 00:00:25,060
to use folk.

7
00:00:28,500 --> 00:00:33,500
Now we're going to assign this button a reference to our use or misuse raffle.

8
00:00:33,960 --> 00:00:36,680
So to clipboard icon and give it to Jeff.

9
00:00:37,380 --> 00:00:40,860
And that is going to be equal to a copy button.

10
00:00:42,230 --> 00:00:44,930
All right, so we are certain of the difference now in diameter.

11
00:00:45,500 --> 00:00:52,130
Now let's create a method that is going to help us to copy our data from Iowa so that we can save it

12
00:00:52,730 --> 00:00:53,720
inside a clipboard.

13
00:00:54,140 --> 00:01:00,680
So let's create a constant animate copy from.

14
00:01:03,080 --> 00:01:10,760
Clipboard and this is going to be an area function, and this is going to have a body and the first

15
00:01:10,760 --> 00:01:15,740
thing to do is that it will be creating a constant new text area.

16
00:01:20,350 --> 00:01:22,660
Now this is going to be equal to a document.

17
00:01:33,350 --> 00:01:36,800
Document that create element and this is going to be of type text area.

18
00:01:37,310 --> 00:01:41,720
So that's why the I mean the text, you know, after this, what I want to do is that we're going to

19
00:01:41,720 --> 00:01:44,780
assign this text to area property.

20
00:01:44,850 --> 00:01:49,460
I must say I value and that is going to be a password because we want to copy a password, right?

21
00:01:49,880 --> 00:01:56,450
So in your text area, not in a text, which is going to be called a password.

22
00:01:58,400 --> 00:02:05,870
So we are copying our password into new text area, and now we need to appended so document the body.

23
00:02:08,100 --> 00:02:14,510
Append child, and this is going to be passed to a new text area.

24
00:02:15,840 --> 00:02:21,030
All right, so we have appointed a child now we need to selected to a new tax area.

25
00:02:21,410 --> 00:02:22,080
Let's select.

26
00:02:30,970 --> 00:02:32,800
No Dixie Command.

27
00:02:33,340 --> 00:02:38,950
And this is going to be holding a value copy now after this will be removing it.

28
00:02:39,100 --> 00:02:40,390
So new text area.

29
00:02:41,970 --> 00:02:48,120
And three months now until plasticity remote function, it is going to remove our child.

30
00:02:48,660 --> 00:02:52,380
So after this will be creating will be adding copy button.

31
00:02:54,080 --> 00:02:54,920
The current.

32
00:02:56,560 --> 00:02:57,490
They're disabled.

33
00:03:01,430 --> 00:03:02,690
Being equal to false.

34
00:03:04,300 --> 00:03:10,720
Then you will go to and after it is true, will be creating a set time old method to set timeout.

35
00:03:11,080 --> 00:03:16,840
And this is going to have another function and this needs to work when copy.

36
00:03:18,310 --> 00:03:21,700
But under current.

37
00:03:23,420 --> 00:03:27,740
The disabled is going to turn to for.

38
00:03:29,310 --> 00:03:33,310
After three seconds, so passes 3000 milliseconds.

39
00:03:33,930 --> 00:03:38,400
OK, so we have set it up to function and that is going to copy our data from a clipboard.

40
00:03:38,450 --> 00:03:44,670
Now we need to create another method that is going to notify the user that we have successfully copied

41
00:03:44,670 --> 00:03:45,150
our data.

42
00:03:45,780 --> 00:03:47,100
So that's what we're going to do next.
