Skip to content

Commit

Permalink
Remove brand helper from translation nav component
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Sep 24, 2024
1 parent 4a8eca7 commit de1429c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<%
add_gem_component_stylesheet("translation-nav")

brand ||= false
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
%>
<% if translation_helper.has_translations? %>
<nav role="navigation"
class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %>"
aria-label="<%= t("common.translations") %>"
>
<ul class="gem-c-translation-nav__list">
Expand All @@ -20,7 +18,7 @@
hreflang: translation[:locale],
lang: translation[:locale],
rel: "alternate",
class: "govuk-link gem-c-translation-nav__link #{brand_helper.color_class}",
class: "govuk-link gem-c-translation-nav__link",
data: translation[:data_attributes]
%>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ examples:
active: true
context:
right_to_left: true
with_branding:
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component_branding.md) can be added to the component as shown.
data:
brand: 'wales-office'
translations:
- locale: 'en'
base_path: '/en'
text: 'English'
active: true
- locale: 'cy'
base_path: '/cy'
text: 'Cymraeg'
with_no_top_margin:
data:
no_margin_top: true
Expand Down
6 changes: 0 additions & 6 deletions spec/components/translation_nav_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ def multiple_translations
assert_select "nav[role='navigation'][aria-label='Translations']"
end

it "adds branding correctly" do
render_component(translations: multiple_translations, brand: "attorney-generals-office")
assert_select ".gem-c-translation-nav.brand--attorney-generals-office"
assert_select ".gem-c-translation-nav .brand__color"
end

it "has no margin top when option passed" do
render_component(translations: multiple_translations, no_margin_top: true)
assert_select ".gem-c-translation-nav--no-margin-top"
Expand Down

0 comments on commit de1429c

Please sign in to comment.