WIP Profile settings page

Show the user's user address, and provide a button for copying it to the
clipboard
This commit is contained in:
Râu Cao
2023-01-09 16:51:04 +08:00
parent f1ef257c97
commit 029e6b011d
5 changed files with 40 additions and 3 deletions

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy <%= custom_class %>"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 372 B

View File

@@ -3,7 +3,30 @@
<%= render MainWithSidenavComponent.new(sidenav_partial: 'shared/sidenav_settings') do %>
<section>
<h3>Profile</h3>
<p class="mb-12">
<p class="mb-1">
<%= label :user_address, 'User address', class: 'font-bold' %>
</p>
<p class="flex gap-1 mb-2 sm:block">
<input type="text" id="user_address" class="flex-1 sm:w-3/5"
value=<%= @user.address %> disabled="disabled" />
<button id="copy-user-address" class="btn-md btn-icon btn-blue flex-none w-auto"
title="Copy to clipboard">
<span class="icon-initial">
<%= render partial: "icons/copy", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
<span class="icon-active hidden">
<%= render partial: "icons/check", locals: { custom_class: "text-white h-4 w-4 inline" } %>
</span>
</button>
</p>
<p class="text-sm text-gray-500">
Your user address for Chat and Lightning Network.
</p>
<%# <%= form_for(@user, as: "profile", url: settings_profile_path) do |f| %>
<%# <p class="mt-8">
<%# <%= f.submit "Save changes", class: 'btn-md btn-blue w-full sm:w-auto' %>
<%# </p>
<%# <% end %>
</section>
<% end %>