Skip to content

Commit

Permalink
Refactor centering of component
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshAntBrown committed Apr 29, 2024
1 parent 95471b6 commit 44fbdd5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/helpers/signups_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SignupsHelper
def render_signup_form(centered: false)
def render_signup_form
turbo_frame_tag "signup_form" do
render "signups/form", centered: centered
render "signups/form"
end
end
end
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
<%= yield %>
</main>
<footer>
<%= render_signup_form %>
<div class="max-w-96">
<%= render_signup_form %>
</div>
</footer>
</body>
</html>
4 changes: 3 additions & 1 deletion app/views/pages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
</div>
OS for your personal finances <%= image_tag("icon-chart.svg", alt: "Chart", class: "inline") %> built by a small team <%= image_tag("icon-team.png", alt: "Maybe Team", class: "inline h-9") %> alongside an incredible community <%= image_tag("icon-discord.svg", alt: "Discord", class: "inline") %>
</div>
<%= render_signup_form(centered: true) %>
<div class="max-w-96 mx-auto">
<%= render_signup_form %>
</div>
</div>
5 changes: 2 additions & 3 deletions app/views/signups/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<%# locals: (centered: false) -%>
<%= form_with( url: signups_path ) do |f| %>
<div class="inline-flex flex-row border rounded-xl bg-white p-1 w-full max-w-96 mb-4 shadow-xs">
<div class="flex flex-row border rounded-xl bg-white p-1 w-full mb-4 shadow-xs">
<%= f.email_field :email, placeholder: "Enter your email address", class: "flex-1 border-0 px-2 focus:ring-0 text-sm" %>
<%= f.submit "Join waitlist", class: "py-2 px-3 font-medium text-white bg-neutral-900 rounded-lg hover:bg-neutral-800 border border-neutral-900 text-sm" %>
</div>

<p class="text-xs text-[#737373] max-w-96 <%= "mx-auto" if centered %>">This waitlist is for a hosted version of the app. Don't want to wait? <a href="https://github.com/maybe-finance/maybe" class="text-[#141414] underline">Self-host</a> an early version of Maybe.</p>
<p class="text-xs text-[#737373]">This waitlist is for a hosted version of the app. Don't want to wait? <a href="https://github.com/maybe-finance/maybe" class="text-[#141414] underline">Self-host</a> an early version of Maybe.</p>
<% end %>

0 comments on commit 44fbdd5

Please sign in to comment.