diff --git a/app/views/govuk_publishing_components/components/_subscription-links.html.erb b/app/views/govuk_publishing_components/components/_subscription-links.html.erb index dd3d2d9483..78a28c048d 100644 --- a/app/views/govuk_publishing_components/components/_subscription-links.html.erb +++ b/app/views/govuk_publishing_components/components/_subscription-links.html.erb @@ -1,57 +1,40 @@ <% - email_signup_link ||= false - email_signup_link_text ||= t("govuk_component.subscription_links.email_signup_link_text", default: "Get email alerts") - email_signup_link_data_attributes ||= false - - feed_link ||= false - feed_link_text ||= t("govuk_component.subscription_links.feed_link_text", default: "Subscribe to feed") - feed_link_box_value ||= false - feed_link_data_attributes ||= {} - - tracking_is_present = true if email_signup_link_data_attributes || feed_link_data_attributes.any? - brand ||= false brand_helper = GovukPublishingComponents::Presenters::BrandHelper.new(brand) - - if feed_link_box_value - feed_link = "#" - feed_box_id = SecureRandom.hex(2) - feed_link_data_attributes[:controls] = "feed-reader-#{feed_box_id}" - feed_link_data_attributes[:expanded] = "false" - end + sl_helper = GovukPublishingComponents::Presenters::SubscriptionLinksHelper.new(local_assigns) %> -<% if email_signup_link || feed_link || feed_link_box_value %> +<% if sl_helper.component_data_is_valid? %>