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:
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user