Skip to content

Commit 92b9984

Browse files
authored
WEB-958: Add interaction feedback to account number copy button (#3601)
1 parent bbf2ea9 commit 92b9984

2 files changed

Lines changed: 42 additions & 6 deletions

File tree

src/app/shared/account-number/account-number.component.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88

99
<span (mouseenter)="mouseEnter()" (mouseleave)="mouseLeave()">
1010
@if (displayL && iconVisible) {
11-
<span class="m-l-5" (click)="copyValue()"
12-
><b><fa-icon icon="copy" size="sm" title="{{ 'labels.text.Copy Account Number' | translate }}"></fa-icon></b
13-
></span>
11+
<button
12+
mat-icon-button
13+
class="copy-btn m-l-5"
14+
(click)="copyValue(); $event.stopPropagation()"
15+
[attr.aria-label]="'labels.text.Copy Account Number' | translate"
16+
>
17+
<fa-icon icon="copy" size="sm" [title]="'labels.text.Copy Account Number' | translate"></fa-icon>
18+
</button>
1419
}
1520
@if (accountType) {
1621
<span class="m-l-5">
@@ -21,8 +26,13 @@
2126
<span class="m-l-5">{{ accountNo }}</span>
2227
}
2328
@if (displayR && iconVisible) {
24-
<span class="m-l-3" (click)="copyValue()"
25-
><b><fa-icon icon="copy" size="sm" title="{{ 'labels.text.Copy Account Number' | translate }}"></fa-icon></b
26-
></span>
29+
<button
30+
mat-icon-button
31+
class="copy-btn m-l-3"
32+
(click)="copyValue(); $event.stopPropagation()"
33+
[attr.aria-label]="'labels.text.Copy Account Number' | translate"
34+
>
35+
<fa-icon icon="copy" size="sm" [title]="'labels.text.Copy Account Number' | translate"></fa-icon>
36+
</button>
2737
}
2838
</span>

src/app/shared/account-number/account-number.component.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,29 @@
55
* License, v. 2.0. If a copy of the MPL was not distributed with this
66
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
*/
8+
9+
button.copy-btn {
10+
border: none;
11+
opacity: var(--mdc-icon-button-disabled-icon-opacity, 0.7);
12+
transition:
13+
opacity 0.15s ease-in-out,
14+
transform 0.1s ease-in-out;
15+
16+
.mat-mdc-button-persistent-ripple,
17+
.mat-ripple {
18+
opacity: 0.3;
19+
}
20+
21+
&:hover {
22+
opacity: 1;
23+
}
24+
25+
&:active {
26+
transform: scale(0.85);
27+
}
28+
29+
&:focus-visible {
30+
outline: 1px dashed var(--mdc-outlined-button-outline-color, rgb(255 255 255 / 40%));
31+
outline-offset: 8px;
32+
}
33+
}

0 commit comments

Comments
 (0)