Allow to copy invitation URLs via button

This commit is contained in:
Râu Cao 2023-01-10 13:15:40 +08:00
parent fef29b4fc0
commit c756528d32
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -3,23 +3,29 @@
<%= render MainSimpleComponent.new do %> <%= render MainSimpleComponent.new do %>
<section> <section>
<% if @invitations_unused.any? %> <% if @invitations_unused.any? %>
<p> <p class="mb-8">
Invite your friends to a Kosmos account by sharing an invitation URL with them: Invite your friends to a Kosmos account by sharing an invitation URL with them:
</p> </p>
<table class="mt-12"> <ul>
<thead> <% @invitations_unused.each do |invitation| %>
<tr> <li class="font-mono mb-1 flex gap-1 md:block"
<th>URL</th> data-controller="clipboard">
</tr> <input type="text" disabled class="md:w-3/4 flex-1"
</thead> value="<%= invitation_url(invitation.token) %>"
<tbody> data-clipboard-target="source" />
<% @invitations_unused.each do |invitation| %> <button id="copy-user-address" class="btn-md btn-icon btn-blue flex-none w-auto"
<tr> data-clipboard-target="trigger" data-action="clipboard#copy"
<td class="font-mono"><%= invitation_url(invitation.token) %></td> title="Copy to clipboard">
</tr> <span class="content-initial">
<% end %> <%= render partial: "icons/copy", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</tbody> </span>
</table> <span class="content-active hidden">
<%= render partial: "icons/check", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
</button>
</li>
<% end %>
</ul>
<% else %> <% else %>
<p> <p>
You do not have any invitations to give away yet. We will notify you, You do not have any invitations to give away yet. We will notify you,