Skip to content

Commit cd613ad

Browse files
authored
Merge branch 'master' into docs-who-uses-formation-tech
2 parents c34d913 + f759ac9 commit cd613ad

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

content/discover/who-uses.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
"https://cmdn.io",
179179
"https://ayo.so",
180180
"https://devitjobs.com",
181-
"https://formation.tech"
181+
"https://formation.tech",
182+
"https://gofirmex.com"
182183
]
183184
}
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
import { Component, ElementRef, inject } from '@angular/core';
1+
import {
2+
Component,
3+
ElementRef,
4+
inject,
5+
ChangeDetectorRef,
6+
OnDestroy,
7+
} from '@angular/core';
28

39
@Component({
410
selector: 'app-copy-button',
511
templateUrl: './copy-button.component.html',
612
styleUrls: ['./copy-button.component.scss'],
713
})
8-
export class CopyButtonComponent {
14+
export class CopyButtonComponent implements OnDestroy {
915
public elRef = inject<ElementRef<HTMLElement>>(ElementRef<HTMLElement>);
1016
public copied = false;
17+
public cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);
18+
private revertIconTimeout: ReturnType<typeof setTimeout | null> = null;
1119

1220
onCopy() {
1321
const preRef = this.elRef.nativeElement.querySelector('pre:not(.hide)');
@@ -16,5 +24,18 @@ export class CopyButtonComponent {
1624
}
1725
navigator.clipboard.writeText(preRef.firstChild.textContent);
1826
this.copied = true;
27+
this.cdr.detectChanges();
28+
29+
this.revertIconTimeout = setTimeout(() => {
30+
this.copied = false;
31+
this.cdr.detectChanges();
32+
this.revertIconTimeout = null;
33+
}, 2000);
34+
}
35+
36+
ngOnDestroy(): void {
37+
if (this.revertIconTimeout) {
38+
clearTimeout(this.revertIconTimeout);
39+
}
1940
}
2041
}

0 commit comments

Comments
 (0)