Extract component for account/admin menu links

This way we remove the duplication in the layouts which had these links.

Since we're now passing the `current_user` option to partials in all
cases, IMHO the code is easier to follow if we use the
`Layout::NotificationItemComponent` instead of its partial.
This commit is contained in:
Javi Martín
2023-01-09 16:59:28 +01:00
parent ca28a31ee5
commit 64536f069c
5 changed files with 14 additions and 11 deletions

View File

@@ -28,11 +28,7 @@
<% if show_admin_menu?(user) || namespace != "management" %>
<div id="responsive_menu">
<div class="top-bar-right">
<ul class="menu" data-responsive-menu="medium-dropdown">
<%= render "shared/admin_login_items", current_user: user %>
<%= render "layouts/notification_item", current_user: user %>
<%= render "devise/menu/login_items", current_user: user %>
</ul>
<%= render Layout::AccountMenuComponent.new(user) %>
</div>
</div>
<% end %>