Extract component to render the responsive menu
We were using the same code for the button in both the public and admin headers, so we're removing the duplication. Since the menu and the button must go together, and the contents of the menu are different for different layouts, we're passing these contents using a block. Note the ID of the menu was `responsive-menu` in the public section but `responsive_menu` in the admin section. Since we usually use underscores for IDs and dashes for classes, we're keeping the one with the underscore.
This commit is contained in:
@@ -17,14 +17,7 @@
|
||||
<% end %>
|
||||
</h1>
|
||||
|
||||
<span data-responsive-toggle="responsive-menu" data-hide-for="medium">
|
||||
<button type="button" class="menu-button" data-toggle>
|
||||
<span class="menu-icon"></span>
|
||||
<%= t("application.menu") %>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<div id="responsive-menu" class="responsive-menu">
|
||||
<%= render Layout::ResponsiveMenuComponent.new do %>
|
||||
<%= render Layout::AccountMenuComponent.new(current_user) %>
|
||||
|
||||
<div class="show-for-small-only">
|
||||
@@ -33,7 +26,7 @@
|
||||
<%= render "shared/top_links" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="navigation_bar" class="subnavigation">
|
||||
|
||||
Reference in New Issue
Block a user