diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-07-08 15:13:01 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-07-08 15:13:01 +0700 |
| commit | 6a9e4aaaf73677b3b0650e93560c6738781f76c2 (patch) | |
| tree | a163c623c7d02c80747aaccf5cf4c0fd21833879 /src-migrate/modules/promo | |
| parent | aedf523be9b0faf9cdd7a2231912a074fccdb262 (diff) | |
<iman> update button salin voucher
Diffstat (limited to 'src-migrate/modules/promo')
| -rw-r--r-- | src-migrate/modules/promo/components/Voucher.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src-migrate/modules/promo/components/Voucher.tsx b/src-migrate/modules/promo/components/Voucher.tsx index c978dc7b..b5a25aa9 100644 --- a/src-migrate/modules/promo/components/Voucher.tsx +++ b/src-migrate/modules/promo/components/Voucher.tsx @@ -28,7 +28,8 @@ const Voucher = () => { const vouchers = useMemo(() => voucherQuery.data || [], [voucherQuery.data]); - const copyText = (text: string) => { + const copyText = (text: string, event: React.MouseEvent<HTMLButtonElement>) => { + event.preventDefault(); if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(text) .then(() => { @@ -100,7 +101,7 @@ const Voucher = () => { <div className={style['voucher-code-desc']}>Kode Promo</div> <div className={style['voucher-code']}>{voucher.code}</div> </div> - <button className={style['voucher-copy']} onClick={() => copyText(voucher.code)}>Salin</button> + <button className={style['voucher-copy']} onClick={(event) => copyText(voucher.code, event)}>Salin</button> </div> </div> </div> |
