Add a copy button for the Lightning address
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Same as on profile settings page.
This commit is contained in:
Râu Cao 2023-06-12 18:18:47 +02:00
parent aedaabc7ba
commit 07fe8dba71
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -7,13 +7,25 @@
<section>
<h3>Lightning Address</h3>
<p>
<p class="mb-6">
Your Kosmos user address is also a
<a class="ks-text-link" href="https://lightningaddress.com/" target="_blank">Lightning Address</a>!
The easiest way to receive sats is by just giving out your address:
</p>
<p>
<strong><%= current_user.address %></strong>
<p data-controller="clipboard" class="flex gap-1 sm:w-2/5">
<input type="text" id="user_address" class="grow"
value=<%= current_user.address %> disabled="disabled"
data-clipboard-target="source" />
<button id="copy-user-address" class="btn-md btn-icon btn-blue shrink-0"
data-clipboard-target="trigger" data-action="clipboard#copy"
title="Copy to clipboard">
<span class="content-initial">
<%= render partial: "icons/copy", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
<span class="content-active hidden">
<%= render partial: "icons/check", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
</button>
</p>
</section>