Move navigation and footer partials to components
This way it'll be easier to decide when they should be rendered. In order to be consistent, we're using the `Layout` module for both components; previously, the navigation partial was in the `shared` folder while the footer partial was in the `layout` folder, which IMHO didn't make much sense.
This commit is contained in:
2
app/components/layout/footer_component.rb
Normal file
2
app/components/layout/footer_component.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Layout::FooterComponent < ApplicationComponent
|
||||
end
|
||||
3
app/components/layout/subnavigation_component.rb
Normal file
3
app/components/layout/subnavigation_component.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Layout::SubnavigationComponent < ApplicationComponent
|
||||
delegate :content_block, :layout_menu_link_to, to: :helpers
|
||||
end
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<div class="show-for-small-only">
|
||||
<div class="subnavigation subnavigation-with-top-links">
|
||||
<%= render "shared/subnavigation" %>
|
||||
<%= render Layout::SubnavigationComponent.new %>
|
||||
<%= render "shared/top_links" %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<div id="navigation_bar" class="subnavigation">
|
||||
<div class="hide-for-small-only">
|
||||
<%= render "shared/subnavigation" %>
|
||||
<%= render Layout::SubnavigationComponent.new %>
|
||||
</div>
|
||||
|
||||
<%= yield :header_addon %>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<%= yield %>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<%= render "layouts/footer" %>
|
||||
<%= render Layout::FooterComponent.new %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<%= render "layouts/footer" %>
|
||||
<%= render Layout::FooterComponent.new %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user