Skip to content

Commit 024c4c0

Browse files
committed
fix: add copy button to address history popup
1 parent aae0ad8 commit 024c4c0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/desktop/components/popups/AddressHistoryPopup.svelte

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
<script lang="ts">
22
import { getSelectedAccount } from '@core/account'
33
import { localize } from '@core/i18n'
4-
import { truncateString } from '@core/utils'
4+
import { setClipboard, truncateString } from '@core/utils'
55
import { AccountAddress } from '@iota/sdk/out/types'
66
import VirtualList from '@sveltejs/svelte-virtual-list'
77
import { FontWeight, KeyValueBox, Spinner, Text, TextType } from 'shared/components'
88
import { onMount } from 'svelte'
9+
import { Icon } from '@ui'
10+
import { Icon as IconEnum } from '@auxiliary/icon'
911
1012
let addressList: AccountAddress[] | undefined = undefined
1113
14+
function onCopyClick(): void {
15+
const addresses = addressList.map((address) => address.address).join(',')
16+
setClipboard(addresses)
17+
}
18+
1219
onMount(() => {
1320
getSelectedAccount()
1421
?.addresses()
@@ -26,7 +33,12 @@
2633
<Text type={TextType.h3} fontWeight={FontWeight.semibold} lineHeight="6">
2734
{localize('popups.addressHistory.title')}
2835
</Text>
29-
<Text fontSize="15" color="gray-700" classes="text-left">{localize('popups.addressHistory.disclaimer')}</Text>
36+
<div class="flex w-full items-center justify-between">
37+
<Text fontSize="15" color="gray-700" classes="text-left">{localize('popups.addressHistory.disclaimer')}</Text>
38+
<button on:click={onCopyClick} class="text-gray-500 dark:text-gray-100 p2" type="button">
39+
<Icon icon={IconEnum.Copy} />
40+
</button>
41+
</div>
3042
{#if addressList}
3143
{#if addressList.length > 0}
3244
<div class="w-full flex-col space-y-2 virtual-list-wrapper">

0 commit comments

Comments
 (0)