Skip to content

Commit

Permalink
Use component wrapper on super navigation header
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Jan 9, 2025
1 parent 29c5124 commit dca99cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--blue-background" if blue_background
search_toggle_button_classes << "gem-c-layout-super-navigation-header__search-toggle-button--large-navbar" if large_navbar

layout_super_navigation_header_classes = %w(gem-c-layout-super-navigation-header)
layout_super_navigation_header_classes << "gem-c-layout-super-navigation-header--blue-background" if blue_background

item_link_classes = %w(gem-c-layout-super-navigation-header__navigation-item-link)
item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--blue-background" if blue_background
item_link_classes << "gem-c-layout-super-navigation-header__navigation-item-link--large-navbar" if large_navbar
Expand All @@ -64,16 +61,14 @@
dropdown_menu_classes << "gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar" if large_navbar

absolute_links_helper = GovukPublishingComponents::Presenters::AbsoluteLinksHelper.new()

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-layout-super-navigation-header")
component_helper.add_class("gem-c-layout-super-navigation-header--blue-background") if blue_background
component_helper.add_role("banner")
component_helper.add_data_attribute({ module: "ga4-event-tracker ga4-link-tracker", ga4_expandable: "" })
%>
<%= content_tag("header",
{
role: "banner",
class: layout_super_navigation_header_classes,
data: {
module: "ga4-event-tracker ga4-link-tracker",
"ga4-expandable": '',
}
}) do %>
<%= tag.header(**component_helper.all_attributes) do %>
<div class="gem-c-layout-super-navigation-header__container govuk-clearfix">
<div class="govuk-width-container">
<%= content_tag(:div, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ accessibility_excluded_rules:
- duplicate-id-aria
- landmark-no-duplicate-banner
- landmark-unique
uses_component_wrapper_helper: true
examples:
default:
with_custom_logo_link:
Expand Down

0 comments on commit dca99cb

Please sign in to comment.