Skip to content

Commit 923a8b9

Browse files
committed
feat(e2e): disabling copy link button while generating link
and for 5 seconds post copying link to clipboard
1 parent aac4b08 commit 923a8b9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

components/buttons/copyLink.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
class="inline-flex gap-1 justify-center justify-self-end items-center p-2 text-sm rounded-md shadow transition-transform transform focus-visible:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg copy-uri-button"
66
aria-label="Click here to copy url to clipboard"
77
:class="{
8-
'bg-blue-500 text-white': copied === false,
8+
'bg-blue-500 text-white': !copied,
99
'bg-green-500 text-gray-800': copied === true,
10-
'bg-blue-500 text-white animate-pulse': copied === null,
10+
'pointer-events-none': copied === null || copied === true,
1111
}"
12-
:disabled="copied === null"
12+
:disabled="copied === null || copied === true"
1313
@click="clickHandler"
1414
>
1515
<span
@@ -21,7 +21,14 @@
2121
<Copied />
2222
</span>
2323
<span v-show="copied" class="hidden md:inline-block">Copied</span>
24-
<span v-show="!copied" class="inline" aria-hidden="true">
24+
<span
25+
v-show="!copied"
26+
class="inline"
27+
aria-hidden="true"
28+
:class="{
29+
'animate animate-wiggle': copied === null,
30+
}"
31+
>
2532
<Link />
2633
</span>
2734
<span v-show="!copied" class="hidden md:inline-block">{{

0 commit comments

Comments
 (0)