govuk-components 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '094a8aaa90e8f699ce0844e4770b91f8fc62b7481d9cd2be1fbe480726163f96'
4
- data.tar.gz: b170c99c2ac73c56bf502f26ba232d2abfef6459cebf52c53677e70b8a84c646
3
+ metadata.gz: 381764ecf5e843d375020a7fe394acef575c591b08035da10d2d0303ae07925f
4
+ data.tar.gz: a40ece8066dda10d5bbef274014350967734290aa3f01240a13cd9bb36b52886
5
5
  SHA512:
6
- metadata.gz: 7802eb767bbcf892ab6f3fa5c149db8629f1002bafc2a787e15e67f6317d33df7f23f646f39d92280b8d3db542537ea2b023823548180e51e79042ad19401c18
7
- data.tar.gz: f5b2381662b5c79be177c19a5fa98757e61b8f852f28316b7c12cf3589164bf582f20b83a6632f00576d723597063c130dfcb84db6e1d52a0f7fa6971b3e3c21
6
+ metadata.gz: 238e795f32101c4f5b91dcc3c4e86b4dc2dce8b39f1ab377f353838afc8cb12e192176575d1b7a816ecc8592e213bbb60f1dc22e9a3ebe3b2f3cbbe0ec156e6e
7
+ data.tar.gz: 044ea8db203a2ef93781a066bd9c4559c5d45d11f9cdd76c023c7799d5a6caf4d502687f610e094019f1544a2d56bb6fd990d98a496b7457012a854c6b9406b6
@@ -7,9 +7,13 @@
7
7
  <div class="govuk-notification-banner__content">
8
8
  <% headings.each do |heading| %>
9
9
  <p class="govuk-notification-banner__heading">
10
- <%= heading.text %>
11
- <% if heading.link_target && heading.link_text %>
12
- <%= link_to(heading.link_text, heading.link_target, class: "govuk-notification-banner__link") %>.
10
+ <% if heading.text.present? %>
11
+ <%= heading.text %>
12
+ <% if heading.link_target && heading.link_text %>
13
+ <%= link_to(heading.link_text, heading.link_target, class: "govuk-notification-banner__link") %>.
14
+ <% end %>
15
+ <% else %>
16
+ <%= heading.content %>
13
17
  <% end %>
14
18
  </p>
15
19
  <% end %>
@@ -36,9 +36,9 @@ class GovukComponent::NotificationBanner < GovukComponent::Base
36
36
  class Heading < ViewComponent::Slot
37
37
  attr_accessor :text, :link_target, :link_text
38
38
 
39
- def initialize(text:, link_text: nil, link_target: nil)
40
- @text = text
41
- @link_text = link_text
39
+ def initialize(text: nil, link_text: nil, link_target: nil)
40
+ @text = text
41
+ @link_text = link_text
42
42
  @link_target = link_target
43
43
  end
44
44
 
@@ -1,5 +1,5 @@
1
1
  module Govuk
2
2
  module Components
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - DfE developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-07 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails