Skip to content

Commit

Permalink
pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
adnjoo committed Nov 4, 2024
1 parent b8597e3 commit 1f59803
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions app/controllers/static_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class StaticController < ApplicationController
def pricing
@user = current_user
end
end
2 changes: 0 additions & 2 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Edit <%= resource_name.to_s.humanize %>
</h2>

<%= link_to "Pricing", pricing_path, class: "hover:underline" %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: "space-y-6" }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>

Expand Down
14 changes: 11 additions & 3 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<nav class="bg-gray-800 text-gray-100 p-4 shadow-md">
<nav class="bg-gray-800 text-gray-100 p-4 shadow-md" data-controller="toggle">
<div class="max-w-6xl flex justify-between w-full mx-auto items-center">
<%= link_to root_path, class: "flex items-center" do %>
<%= image_tag "brand/logo_black_no_bg.png", alt: "Logo", class: "h-8 w-auto" %>
<span class="text-lg font-semibold ml-2 hidden lg:block"><%= APP_NAME %></span>
<% end %>
<ul class="flex space-x-4 text-lg">
<% if user_signed_in? %>
<li>
<%= link_to "Log out", destroy_user_session_path, method: :delete, class: "hover:text-gray-400 transition-colors duration-200 ease-in-out" %>
<li class="relative">
<!-- User menu button -->
<button id="user-menu-button" class="text-black hover:underline flex items-center gap-2" data-action="click->toggle#toggle">
<%= render 'shared/profile_picture', user: @user %>
</button>
</li>
<% else %>
<li>
Expand All @@ -16,4 +19,9 @@
<% end %>
</ul>
</div>
<!-- Dropdown menu -->
<div data-toggle-target="toggle" class="hidden">
<%= link_to "Settings", edit_user_registration_path, class: "block px-4 py-2 text-gray-700 hover:bg-gray-100" %>
<%= link_to "Logout", destroy_user_session_path, method: :delete, class: "block px-4 py-2 text-gray-700 hover:bg-gray-100" %>
</div>
</nav>
9 changes: 0 additions & 9 deletions app/views/notes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<div class="my-container" data-controller="toggle">
<h1 class="text-4xl font-bold tracking-wide text-black mb-6 border-b-4 border-black">
Your Notes
</h1>

<%= link_to edit_user_registration_path, class: 'text-black hover:underline flex flex-row gap-2 items-center' do %>
<%= render 'shared/profile_picture', user: @user %>
<span>Settings</span>
<% end %>

<h3 class="my-8 text-xl font-bold tracking-wide text-black">
⭐️: <%= @points.count %>
</h3>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_profile_picture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<% if user.present? && user.persisted? && user.profile_picture.attached? %>
<%= image_tag user.profile_picture, alt: user.username, class: "h-10 w-10 rounded-full flex border border-black object-cover" %>
<% else %>
<%= image_tag "default-avatar.png", alt: user.username, class: "h-10 w-10 rounded-full flex" %>
<%= image_tag "default-avatar.png", alt: "default-avatar", class: "h-10 w-10 rounded-full flex" %>
<% end %>

0 comments on commit 1f59803

Please sign in to comment.