rm copy to clipboard for tauri and fix invisible icons

pull/26/head
Laurin Weger 6 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; 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) => { const on_click = (e) => {
has_success = true; has_success = true;
setTimeout(() => (has_success = false), 2_000); setTimeout(() => (has_success = false), 2_000);
setClipboard(value);
navigator.clipboard.writeText(value);
}; };
</script> </script>
@ -22,9 +32,10 @@
disabled disabled
readonly readonly
/> />
{#if !tauri_platform}
<button <button
on:click={on_click} 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}> <span id="default-icon" class:hidden={has_success}>
<svg <svg
@ -61,5 +72,6 @@
</svg> </svg>
</span> </span>
</button> </button>
{/if}
</div> </div>
</div> </div>

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

Loading…
Cancel
Save