Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Clean up registration and session views (#279)

Jarrett Lusso472746df0644
diff --git a/app/views/layouts/auth.html.erb b/app/views/layouts/auth.html.erb
index e6720d52..1b702ea2 100644
--- a/app/views/layouts/auth.html.erb
+++ b/app/views/layouts/auth.html.erb
@@ -33,14 +33,14 @@
<%= content_for?(:header_title) ? yield(:header_title).html_safe : "Your account" %>
</h2>
- <% if params[:controller] == "devise/sessions" && params[:action] == "new" %>
- <p class="mt-2 text-sm text-center text-gray-600">
- or <%= link_to "create an account", new_user_registration_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %>
- </p>
- <% elsif params[:controller] == "devise/registrations" && params[:action] == "new" %>
- <p class="mt-2 text-sm text-center text-gray-600">
- or <%= link_to "sign in to your account", new_user_session_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %>
- </p>
+ <% if controller_name == "sessions" %>
+ <p class="mt-2 text-sm text-center text-gray-600">
+ or <%= link_to "create an account", new_registration_path, class: 'font-medium text-gray-600 hover:text-gray-400 transition' %>
+ </p>
+ <% elsif controller_name == "registrations" %>
+ <p class="mt-2 text-sm text-center text-gray-600">
+ or <%= link_to "sign in to your account", new_session_path, class: 'font-medium text-gray-600 hover:text-gray-400 transition' %>
+ </p>
<% end %>
</div>
@@ -50,7 +50,7 @@
</div>
<div class="p-8 mt-2 text-center">
- <p class="mt-6 text-sm text-black"><a href="/privacy" class="text-black opacity-90">Privacy Policy</a> &bull; <a href="/terms" class="text-black opacity-90">Terms of Service</a></p>
+ <p class="mt-6 text-sm text-black"><a href="/privacy" class="font-medium text-gray-600 hover:text-gray-400 transition">Privacy Policy</a> &bull; <a href="/terms" class="font-medium text-gray-600 hover:text-gray-400 transition">Terms of Service</a></p>
</div>
</div>
diff --git a/app/views/registrations/new.html.erb b/app/views/registrations/new.html.erb
index 9f3c5c6d..5b21f599 100644
--- a/app/views/registrations/new.html.erb
+++ b/app/views/registrations/new.html.erb
@@ -35,7 +35,3 @@
<%= form.submit "Continue", class: 'flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow' %>
</div>
<% end %>
-
-<div class="mt-6 text-center">
- <p class="text-sm text-gray-600">Already have an account? <%= link_to "Sign in", new_session_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
-</div>
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 06e3f1f0..93acd91f 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -2,11 +2,6 @@
header_title "Sign in to your account"
%>
-<div class="mt-0 text-center">
- <p class="text-sm text-gray-600">Don't have an account? <%= link_to "Create one", new_registration_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
-</div>
-
-
<%= form_with url: session_path, html: {class: 'space-y-6'} do |form| %>
<div class="relative border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
<%= form.label :email, "Email address", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %>
@@ -24,5 +19,5 @@
<% end %>
<div class="mt-6 text-center">
- <p class="text-sm text-gray-600">Forgot your password? <%= link_to "Reset it", new_password_reset_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
+ <p class="text-sm text-gray-600">Forgot your password? <%= link_to "Reset it", new_password_reset_path, class: 'font-medium text-gray-600 hover:text-gray-400 transition' %></p>
</div>