Skip to content

Commit

Permalink
fix wallet inpet
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed May 16, 2024
1 parent df1d996 commit 579ed5f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
11 changes: 11 additions & 0 deletions app/packs/stylesheets/decidim/vocdoni/admin/vocdoni.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,14 @@ a.button__alert {
.publish-text p {
@apply mb-2
}

.wallet-container {
@apply w-full mx-auto py-2;
}
.wallet-input {
@apply rounded-none rounded-s-md block flex-1 min-w-0 w-full text-sm p-3 border;
}

button.copy-button {
@apply rounded-none rounded-r-md;
}
24 changes: 4 additions & 20 deletions app/views/decidim/vocdoni/admin/steps/_available_credits.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<%= append_javascript_pack_tag "decidim_vocdoni_admin" %>
<%= append_stylesheet_pack_tag "decidim_vocdoni_admin" %>
<div class="bg-gray-5 p-4">
<div class="flex items-center">
<%= icon "bank-card-line", role: "img", "aria-hidden": true %>&nbsp;
Expand All @@ -18,33 +20,15 @@
</p>
</div>
</div>
<% if Decidim::Vocdoni.api_endpoint_env == "dev" %>
<% if Decidim::Vocdoni.api_endpoint_env == "prod" %>
<div class="callout warning">
<p>
<%= t("decidim.vocdoni.admin.steps.credits.prod_mode_html",
reseller_name: Decidim::Vocdoni.vocdoni_reseller_name,
reseller_email: Decidim::Vocdoni.vocdoni_reseller_email,
wallet_address: @current_vocdoni_wallet.private_key).html_safe %>
</p>
<div class="input-group">
<input id="wallet-address"
class="input-group-field"
type="text"
autocomplete="off"
value="<%= @current_vocdoni_wallet.private_key %>"
title="Wallet Address"
readonly>
<div class="input-group-button">
<button class="button button__secondary button__sm"
data-clipboard-copy="#wallet-address"
data-clipboard-copy-label="<%= t("copied", scope: "decidim.vocdoni.admin.steps.credits") %>"
data-clipboard-copy-message="<%= t("copy_wallet_message", scope: "decidim.vocdoni.admin.steps.credits") %>"
aria-label="<%= t("copy_wallet_clarification", scope: "decidim.vocdoni.admin.steps.credits") %>">
<%= icon("clipboard-line", role: "img", "aria-hidden": "true") %>
<%= t("copy_wallet", scope: "decidim.vocdoni.admin.steps.credits") %>
</button>
</div>
</div>
<%= render(partial: "wallet_address") %>
</div>
<% else %>
<div class="callout warning">
Expand Down
19 changes: 19 additions & 0 deletions app/views/decidim/vocdoni/admin/steps/_wallet_address.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="wallet-container">
<div class="flex">
<input id="wallet-address"
class="wallet-input"
type="text"
autocomplete="off"
value="<%= @current_vocdoni_wallet.private_key %>"
title="Wallet Address"
readonly>
<button class="button button__secondary button__sm copy-button"
data-clipboard-copy="#wallet-address"
data-clipboard-copy-label="<%= t("copied", scope: "decidim.vocdoni.admin.steps.credits") %>"
data-clipboard-copy-message="<%= t("copy_wallet_message", scope: "decidim.vocdoni.admin.steps.credits") %>"
aria-label="<%= t("copy_wallet_clarification", scope: "decidim.vocdoni.admin.steps.credits") %>">
<%= icon("clipboard-line", role: "img", "aria-hidden": "true") %>
<%= t("copy_wallet", scope: "decidim.vocdoni.admin.steps.credits") %>
</button>
</div>
</div>

0 comments on commit 579ed5f

Please sign in to comment.