Skip to content

Commit

Permalink
feat(frontend): receive address copy button (#3020)
Browse files Browse the repository at this point in the history
# Motivation

For #3013 we need a new "Copy address" button. As explained in PR #3014,
for now it just gonna be dedicated to the address and uses the existing
function that was extracted in this related PR.

# Changes

- Create a "Copy receive address" button component.
  • Loading branch information
peterpeterparker authored Oct 21, 2024
1 parent 7051ad5 commit b57290b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/frontend/src/lib/components/receive/ReceiveCopy.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts">
import IconCopy from '$lib/components/icons/IconCopy.svelte';
import ButtonIcon from '$lib/components/ui/ButtonIcon.svelte';
import { copyToClipboard } from '$lib/utils/clipboard.utils';
export let address: string;
export let copyAriaLabel: string;
</script>

<ButtonIcon
ariaLabel={copyAriaLabel}
on:click={async () => await copyToClipboard({ value: address, text: copyAriaLabel })}
>
<IconCopy size="24" slot="icon" />
</ButtonIcon>

0 comments on commit b57290b

Please sign in to comment.