rm copy to clipboard for tauri and fix invisible icons

pull/26/head
Laurin Weger 3 months ago
parent 9a4d0d8c49
commit c3ad6a60cc
No known key found for this signature in database
GPG Key ID: 9B372BB0B792770F
  1. 18
      ng-app/src/lib/components/CopyToClipboard.svelte
  2. 3
      ng-app/src/routes/WalletCreate.svelte

@ -4,11 +4,21 @@
let has_success: boolean = false;
const tauri_platform = import.meta.env.TAURI_PLATFORM;
const setClipboard = async (text: string) => {
if (tauri_platform) {
// TODO: this won't work for tauri platform.
// const { writeText } = await import("@tauri-apps/api/clipboard");
// await writeText(text);
} else {
navigator.clipboard.writeText(text);
}
};
const on_click = (e) => {
has_success = true;
setTimeout(() => (has_success = false), 2_000);
navigator.clipboard.writeText(value);
setClipboard(value);
};
</script>
@ -22,9 +32,10 @@
disabled
readonly
/>
{#if !tauri_platform}
<button
on:click={on_click}
class="absolute end-2 top-1/2 -translate-y-1/2 bg-gray-50 shadow-none text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg p-2 inline-flex items-center justify-center"
class="absolute inset-y-0 right-0 p-3 flex items-center text-sm leading-5 bg-transparent shadow-none"
>
<span id="default-icon" class:hidden={has_success}>
<svg
@ -61,5 +72,6 @@
</svg>
</span>
</button>
{/if}
</div>
</div>

@ -10,6 +10,7 @@
-->
<!--
@component
Wallet creation page.
This component manages the whole UX flow, gives infos about wallets,
offers available brokers, handles wallet creation,
@ -1689,7 +1690,7 @@
>
<svelte:component
this={emoji.svg?.default}
class="text-5xl"
class="text-5xl w-full"
/>
</div>
<div class="flex flex-col ml-4">

Loading…
Cancel
Save