Skip to content

Commit

Permalink
feat: Implement a list of known addresses in AddressHistoryPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev committed Nov 2, 2023
1 parent c1268f4 commit dcf1e70
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion packages/desktop/components/popups/AddressHistoryPopup.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
<div>Address history popup</div>
<script lang="ts">
import { localize } from '@core/i18n'
import { CopyableBox, FontWeight, Spinner, Text, TextType } from 'shared/components'
import { getSelectedAccount } from '@core/account'
import { truncateString } from '@core/utils'
</script>

<div class="flex flex-col space-y-6">
<Text type={TextType.h3} fontWeight={FontWeight.semibold} lineHeight="6">
{localize('Address History')}
</Text>

{#await getSelectedAccount()?.addresses()}
<div class="flex">
<Spinner message="Loading addresses..." />
</div>
{:then addresses}
{#if addresses && addresses?.length > 0}
<div class="flex flex-col">
{#each addresses as address}
<CopyableBox col value={address.address} classes="mb-2">
<div class="flex items-center justify-center">
<Text type={TextType.h4} secondary classes="mr-3">
{address.keyIndex}:
</Text>
<Text type={TextType.h5} smaller>
{truncateString(address.address, 16, 16)}
</Text>
</div>
</CopyableBox>
{/each}
</div>
{:else}
<div>No addresses</div>
{/if}
{/await}
</div>

0 comments on commit dcf1e70

Please sign in to comment.