Render header on sdg index page

We no longer show the static header when we have created a
custom header.
This commit is contained in:
taitus
2021-02-19 09:56:23 +01:00
committed by Javi Martín
parent e639cab994
commit 4a880fc1c5
6 changed files with 33 additions and 10 deletions

View File

@@ -1,9 +1,13 @@
<% provide(:title) { title } %>
<main class="sdg-goals-index">
<header class="section-header">
<h1><%= title %></h1>
</header>
<% if header.present? %>
<%= render "shared/header", header: header %>
<% else %>
<header class="section-header">
<h1><%= title %></h1>
</header>
<% end %>
<%= render Shared::BannerComponent.new("sdg") %>

View File

@@ -1,9 +1,10 @@
class SDG::Goals::IndexComponent < ApplicationComponent
attr_reader :goals, :phases
attr_reader :goals, :header, :phases
delegate :link_list, to: :helpers
def initialize(goals, phases)
def initialize(goals, header:, phases:)
@goals = goals
@header = header
@phases = phases
end