Skip to content

Commit

Permalink
Remove shared helper for margin
Browse files Browse the repository at this point in the history
- removes the shared helper call to set margin, as this is now handled by the component wrapper helper, which all of these components already use
- one of these didn't seem to be using the shared helper at all
  • Loading branch information
andysellick committed Dec 17, 2024
1 parent 2890d53 commit fa2a8ae
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions app/views/components/_expander.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
<%
title ||= false
open_on_load ||= false
margin_bottom ||= 0

content_id = "expander-content-#{SecureRandom.hex(4)}"
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_data_attribute({ module: "expander" })
component_helper.add_data_attribute({ "open-on-load": open_on_load })
component_helper.add_class("app-c-expander")
component_helper.add_class(shared_helper.get_margin_bottom) unless margin_bottom == 0
component_helper.add_data_attribute({ "button-data-attributes": button_data_attributes }) if local_assigns.include?(:button_data_attributes)
%>
<% if title %>
Expand Down
3 changes: 0 additions & 3 deletions app/views/components/_filter_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
raise ArgumentError, "reset_link_href is required" if show_reset_link && !local_assigns[:reset_link_href]

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
component_helper.add_data_attribute({ module: "filter-panel ga4-event-tracker" })
component_helper.add_class("app-c-filter-panel")
component_helper.add_class(shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
%>

<%= tag.div(**component_helper.all_attributes) do %>
<div class="app-c-filter-panel__header">
<%= tag.button(
Expand Down
1 change: 0 additions & 1 deletion app/views/components/_filter_section.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<% add_app_component_stylesheet("filter-section") %>
<%
raise ArgumentError, "heading_text is required" unless local_assigns[:heading_text]
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
open ||= nil
status_text ||= ""
heading_level ||= 2
Expand Down
3 changes: 0 additions & 3 deletions app/views/components/_filter_summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
reset_link_href ||= nil
reset_link_text ||= "Clear all filters"

shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class(shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
component_helper.add_data_attribute({ module: "ga4-event-tracker" })
component_helper.add_class("app-c-filter-summary")
%>

<%= tag.div(**component_helper.all_attributes) do %>
<%= content_tag("h#{heading_level}", heading_text, class: "app-c-filter-summary__heading") %>

Expand Down

0 comments on commit fa2a8ae

Please sign in to comment.