11<script setup lang="ts">
22import type { FavoriteAddress } from ' @/types' ;
3- import { fromWeiToEth , shortenFavAddr } from ' @/utils/utils' ;
3+ import { fromWeiToEth , shortenFavAddr , handleClickCopyIcon } from ' @/utils/utils' ;
44
55const emit = defineEmits ([' deleteFavorite' ]);
66
@@ -11,17 +11,6 @@ defineProps<{
1111const handleDeleteFavorite = (address : string ) => {
1212 emit (' deleteFavorite' , address );
1313};
14-
15- const handleCopy = (event : Event , text : string ) => {
16- const target = event .target as HTMLElement ;
17- target .classList .remove (' bi-copy' );
18- target .classList .add (' bi-check2' );
19- navigator .clipboard .writeText (text );
20- setTimeout (() => {
21- target .classList .add (' bi-copy' );
22- target .classList .remove (' bi-check2' );
23- }, 2000 );
24- };
2514 </script >
2615
2716<template >
@@ -32,7 +21,7 @@ const handleCopy = (event: Event, text: string) => {
3221 {{ shortenFavAddr(fav.address) }}
3322 </RouterLink >
3423 <i
35- @click =" (e: Event) => handleCopy (e, fav.address)"
24+ @click =" (e: Event) => handleClickCopyIcon (e, fav.address)"
3625 class =" txn-hash-copy-icon bi bi-copy"
3726 ></i >
3827 <!-- <span v-if="fav.type === 'contract'">(contract)</span> -->
@@ -99,6 +88,7 @@ const handleCopy = (event: Event, text: string) => {
9988.txn-hash-copy-icon {
10089 font-size : 16px ;
10190 cursor : pointer ;
91+ font-style : normal ;
10292}
10393
10494.balance-trash {
@@ -135,6 +125,10 @@ const handleCopy = (event: Event, text: string) => {
135125 color : var (--red-darker );
136126}
137127
128+ .delete-icon i {
129+ font-style : normal ;
130+ }
131+
138132.delete-btn {
139133 cursor : pointer ;
140134 color : var (--btn-red );
0 commit comments