|
1 | 1 | <script lang="ts">
|
2 | 2 | import { getSelectedAccount } from '@core/account'
|
3 | 3 | import { localize } from '@core/i18n'
|
4 |
| - import { truncateString } from '@core/utils' |
| 4 | + import { setClipboard, truncateString } from '@core/utils' |
5 | 5 | import { AccountAddress } from '@iota/sdk/out/types'
|
6 | 6 | import VirtualList from '@sveltejs/svelte-virtual-list'
|
7 | 7 | import { FontWeight, KeyValueBox, Spinner, Text, TextType } from 'shared/components'
|
8 | 8 | import { onMount } from 'svelte'
|
| 9 | + import { Icon } from '@ui' |
| 10 | + import { Icon as IconEnum } from '@auxiliary/icon' |
9 | 11 |
|
10 | 12 | let addressList: AccountAddress[] | undefined = undefined
|
11 | 13 |
|
| 14 | + function onCopyClick(): void { |
| 15 | + const addresses = addressList.map((address) => address.address).join(',') |
| 16 | + setClipboard(addresses) |
| 17 | + } |
| 18 | +
|
12 | 19 | onMount(() => {
|
13 | 20 | getSelectedAccount()
|
14 | 21 | ?.addresses()
|
|
26 | 33 | <Text type={TextType.h3} fontWeight={FontWeight.semibold} lineHeight="6">
|
27 | 34 | {localize('popups.addressHistory.title')}
|
28 | 35 | </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> |
30 | 42 | {#if addressList}
|
31 | 43 | {#if addressList.length > 0}
|
32 | 44 | <div class="w-full flex-col space-y-2 virtual-list-wrapper">
|
|
0 commit comments