lib/ccs/components/ccs/footer/meta.rb in ccs-frontend_helpers-0.3.0 vs lib/ccs/components/ccs/footer/meta.rb in ccs-frontend_helpers-0.5.0.beta0
- old
+ new
@@ -30,11 +30,11 @@
# @param visually_hidden_title [String] ('Support links') title for the meta section
# @param text [String] text to add to the meta section of the footer
# @param context [ActionView::Base] the view context
def initialize(context:, items: nil, visually_hidden_title: nil, text: nil)
- @meta_links = items&.map { |meta_link| Link.new(li_class: 'ccs-footer__inline-list-item', context: context, **meta_link) }
+ @meta_links = items.map { |meta_link| Link.new(li_class: 'ccs-footer__inline-list-item', context: context, **meta_link) } if items.present?
@visually_hidden_title = visually_hidden_title || 'Support links'
@text = text
end
# Generates the HTML for the CCS Footer Meta sections
@@ -43,10 +43,10 @@
def render
capture do
concat(tag.h2(visually_hidden_title, class: 'govuk-visually-hidden'))
if meta_links
- concat(tag.ul(class: 'ccs-footer__inline-list') do
+ concat(tag.ul(class: "ccs-footer__inline-list #{'ccs-footer__inline-list--bottom' unless text}".rstrip) do
meta_links.each { |meta_link| concat(meta_link.render) }
end)
end
concat(tag.div(text, class: 'ccs-footer__meta-custom')) if text
end