Skip to content

Commit 7b52659

Browse files
committed
Add profile and notifications links to navigation
Added a profile link with user avatar to the footer navigation and a notifications link to the user links menu. Updated the user show page to display user links, and added a 'Profile' translation key.
1 parent 77ef5f2 commit 7b52659

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

app/views/shared/_footer_nav.html.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@
2020
<%= inline_svg_tag "svg/bell.svg", class: "size-[1.2em]", "aria-hidden": "true" %>
2121
<span class="dock-label"><%= t("users.notifications.index.title") %></span>
2222
<% end %>
23+
24+
<%= active_link_to user_path, class_active: "dock-active", "aria-label": t("shared.navigation.profile") do %>
25+
<%= user_avatar(current_user, classes: "size-[1.2em]") %>
26+
<span class="dock-label"><%= t("shared.navigation.profile") %></span>
27+
<% end %>
2328
</nav>

app/views/shared/_user_links.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<%= nav_link t("shared.navigation.organizations"), organizations_path, icon: "svg/globe-europe-africa.svg", active: [["organizations", "public/organizations", "users/invitations", "users/membership_requests"], ["index"]] %>
22

3+
<%= nav_link t("users.notifications.index.title"), user_notifications_path, icon: "svg/bell.svg", active: [["organizations", "public/organizations", "users/invitations", "users/membership_requests"], ["index"]] %>
4+
35
<%= nav_link t("users.referrals.index.title"), user_referrals_path, icon: "🎁", badge: "New" %>
46

57
<%= nav_link t("users.connected_accounts.index.title"), user_connected_accounts_path, icon: "🔗" if Rails.application.config.omniauth_providers.any? %>

app/views/users/show.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
<%= render PageComponent.new(full_width: false) do %>
44
<%= render "shared/user_info", user: @user %>
5+
6+
<div class="menu menu-xl w-full"><%= render "shared/user_links", user: @user %></div>
57
<% end %>

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ en:
350350
login: Existing members
351351
logout: Sign out
352352
organizations: Organizations
353+
profile: Profile
353354
register: Sign up
354355
sidebar:
355356
search: Search... ⌘K

0 commit comments

Comments
 (0)