From 0f8272ede44819261ca15fa418da4161cc1987b8 Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 19 Feb 2025 07:25:42 -0800 Subject: [PATCH] [UI] Add an extra hidden profile link to the primary menu (#918) --- app/helpers/icon_helper.rb | 1 + app/javascript/src/styles/common/navigation.scss | 2 ++ app/views/layouts/_main_links.html.erb | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/app/helpers/icon_helper.rb b/app/helpers/icon_helper.rb index 4a628f9ad..fc5bc05fa 100644 --- a/app/helpers/icon_helper.rb +++ b/app/helpers/icon_helper.rb @@ -17,6 +17,7 @@ module IconHelper swatch: %(), settings: %(), log_in: %(), + user: %(), # Utility times: %(), diff --git a/app/javascript/src/styles/common/navigation.scss b/app/javascript/src/styles/common/navigation.scss index ea3bdc8d1..582caaa0b 100644 --- a/app/javascript/src/styles/common/navigation.scss +++ b/app/javascript/src/styles/common/navigation.scss @@ -187,6 +187,8 @@ nav.navigation { padding: 1rem 0.5rem; } li.current a { background-color: themed("color-foreground"); } + + li.nav-hidden { display: none; } } .nav-secondary { diff --git a/app/views/layouts/_main_links.html.erb b/app/views/layouts/_main_links.html.erb index 58373063a..47e689677 100644 --- a/app/views/layouts/_main_links.html.erb +++ b/app/views/layouts/_main_links.html.erb @@ -1,3 +1,8 @@ +<% if CurrentUser.is_anonymous? %> + <%= decorated_nav_link_to("Log In", :log_in, new_session_path, class: "nav-hidden") %> +<% else %> + <%= decorated_nav_link_to("Profile", :user, user_path(CurrentUser.user), class: "nav-hidden") %> +<% end %> <%= decorated_nav_link_to("Artists", :brush, artists_path) %> <%= decorated_nav_link_to("Posts", :images, posts_path) %> <%= decorated_nav_link_to("Pools", :library, gallery_pools_path) %>