Skip to content

Commit

Permalink
[ecosystem] Fix form input error rendering. (aptos-labs#970)
Browse files Browse the repository at this point in the history
* Fix form input error rendering.

* Fix margins when there's an error.

Co-authored-by: Max Kaplan <[email protected]>
  • Loading branch information
zacharydenton and CapCap authored May 13, 2022
1 parent ee76c10 commit ac66bb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AptosFormBuilder < ActionView::Helpers::FormBuilder
options[:class] = [
'font-mono placeholder:text-white text-lg bg-transparent appearance-none border border-white rounded '\
'w-full py-2 px-4 focus:ring-0 focus:border-teal-400',
{ 'border-red-500': @object.errors.any? },
{ 'border-red-500': @object.errors[method].present? },
options[:class]
]
super(method, options)
Expand Down
20 changes: 10 additions & 10 deletions ecosystem/platform/server/app/views/it1_profiles/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@
<h3 class="text-teal-400 font-mono uppercase text-2xl mb-2">Public Keys</h3>
<div class="mb-8"><%= render 'shared/bump' %></div>

<p class="mb-4">
<div class="mb-4">
<%= f.label :consensus_key, class: "font-mono uppercase block mb-2 text-lg" %>
<%= f.text_field :consensus_key, autofocus: true, required: true, pattern: '0x[a-f0-9]{64}' %>
</p>
<p class="mb-4">
</div>
<div class="mb-4">
<%= f.label :account_key, class: "font-mono uppercase block mb-2 text-lg" %>
<%= f.text_field :account_key, required: true, pattern: '0x[a-f0-9]{64}' %>
</p>
<p class="mb-4">
</div>
<div class="mb-4">
<%= f.label :network_key, "Validator Network Key", class: "font-mono uppercase block mb-2 text-lg" %>
<%= f.text_field :network_key, required: true, pattern: '0x[a-f0-9]{64}' %>
</p>
</div>
</div>

<div class="mb-16">
<h3 class="text-teal-400 font-mono uppercase text-2xl mb-2">Validator Node</h3>
<div class="mb-8"><%= render 'shared/bump' %></div>

<p class="mb-4">
<div class="mb-4">
<%= f.label :validator_address, "Address (IP or hostname)", class: "font-mono uppercase block mb-2 text-lg" %>
<%= f.text_field :validator_address, required: true %>
</p>
</div>

<div class="flex gap-8 md:gap-16 mb-4 items-end">
<div class="flex-1">
Expand All @@ -70,10 +70,10 @@
<h3 class="text-teal-400 font-mono uppercase text-2xl mb-2">Full Node</h3>
<div class="mb-8"><%= render 'shared/bump' %></div>

<p class="mb-4">
<div class="mb-4">
<%= f.label :fullnode_address, "Address (IP or hostname)", class: "font-mono uppercase block mb-2 text-lg" %>
<%= f.text_field :fullnode_address %>
</p>
</div>

<p class="mb-4">
<%= f.label :fullnode_network_key, class: "font-mono uppercase block mb-2 text-lg" %>
Expand Down

0 comments on commit ac66bb2

Please sign in to comment.