Skip to content

Commit fff73d8

Browse files
feat: add copy button to address history popup (#7767)
Co-authored-by: Begoña Alvarez <[email protected]>
1 parent 6ee934c commit fff73d8

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Diff for: packages/desktop/components/popups/AddressHistoryPopup.svelte

+16-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { fetchWithTimeout } from '@core/nfts'
77
import { checkActiveProfileAuth, getActiveProfile, updateAccountPersistedDataOnActiveProfile } from '@core/profile'
88
import { getProfileManager } from '@core/profile-manager/stores'
9-
import { truncateString } from '@core/utils'
9+
import { setClipboard, truncateString } from '@core/utils'
1010
import { AccountAddress } from '@iota/sdk/out/types'
1111
import VirtualList from '@sveltejs/svelte-virtual-list'
1212
import { Button, FontWeight, KeyValueBox, Spinner, Text, TextType } from 'shared/components'
@@ -37,6 +37,11 @@
3737
let currentSearchGap = 0
3838
let isBusy = false
3939
40+
function onCopyClick(): void {
41+
const addresses = knownAddresses.map((address) => address.address).join(',')
42+
setClipboard(addresses)
43+
}
44+
4045
onMount(() => {
4146
knownAddresses = $selectedAccount?.knownAddresses
4247
if (!knownAddresses?.length) {
@@ -169,15 +174,16 @@
169174
{/if}
170175
</div>
171176
<div class="flex flex-row flex-nowrap w-full space-x-4 mt-6">
172-
<Button
173-
classes="w-full"
174-
onClick={handleSearchClick}
175-
disabled={isBusy}
176-
{isBusy}
177-
busyMessage={localize('actions.searching')}
178-
>
179-
{localize('actions.search')}
180-
</Button>
177+
<div class="flex w-full justify-center pt-8 space-x-4">
178+
<Button outline classes="w-1/2" onClick={onCopyClick}>{localize('actions.copy')}</Button>
179+
<Button
180+
classes="w-1/2"
181+
onClick={handleSearchClick}
182+
disabled={isBusy}
183+
{isBusy}
184+
busyMessage={localize('actions.searching')}>{localize('actions.search')}</Button
185+
>
186+
</div>
181187
</div>
182188

183189
<style lang="scss">

0 commit comments

Comments
 (0)