diff --git a/app/assets/stylesheets/components/_download-link.scss b/app/assets/stylesheets/components/_download-link.scss deleted file mode 100644 index 35f61a358..000000000 --- a/app/assets/stylesheets/components/_download-link.scss +++ /dev/null @@ -1,19 +0,0 @@ -@import "govuk_publishing_components/individual_component_support"; - -.app-c-download-link { - display: inline-block; - margin-top: govuk-spacing(3); - margin-bottom: govuk-spacing(3); - @include govuk-font(19, $weight: bold); - - @include govuk-media-query($from: tablet) { - margin-top: govuk-spacing(6); - } -} - -.app-c-download-link__icon { - margin-right: .5em; - height: 1.3158em; // 25 / 19 - width: 1.3158em; - vertical-align: middle; -} diff --git a/app/assets/stylesheets/views/_travel-advice.scss b/app/assets/stylesheets/views/_travel-advice.scss index 99726b615..ad03030a3 100644 --- a/app/assets/stylesheets/views/_travel-advice.scss +++ b/app/assets/stylesheets/views/_travel-advice.scss @@ -11,13 +11,22 @@ // TODO: Remove this when components can accept variable unidirectional spacing, // the component above should have a bigger margin-bottom. .map { - margin-top: govuk-spacing(6); + margin: govuk-spacing(6) 0 govuk-spacing(3); @include responsive-bottom-margin; .map-image { max-width: 100%; } } + + .map__link { + margin: govuk-spacing(3) 0; + @include govuk-font-size(19, $line-height: false, $important: false); + + @include govuk-media-query($from: tablet) { + margin: govuk-spacing(6) 0 govuk-spacing(3); + } + } } .metadata__update { diff --git a/app/views/components/_download_link.html.erb b/app/views/components/_download_link.html.erb deleted file mode 100644 index d8c261233..000000000 --- a/app/views/components/_download_link.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% add_app_component_stylesheet("download-link") %> -<% - link_text ||= "Download File" -%> - - - <%= link_text %> - diff --git a/app/views/shared/_travel_advice_first_part.html.erb b/app/views/shared/_travel_advice_first_part.html.erb index 749aab3b7..603a9f086 100644 --- a/app/views/shared/_travel_advice_first_part.html.erb +++ b/app/views/shared/_travel_advice_first_part.html.erb @@ -3,8 +3,14 @@
" alt="<%= content_item.map["alt_text"] %>" class="map-image"> <% if content_item.map_download_url %> -
- <%= render 'components/download_link', href: content_item.map_download_url, link_text: "Download a more detailed map (PDF)" %> + <% end %>
diff --git a/config/initializers/dartsass.rb b/config/initializers/dartsass.rb index 7611ffd9b..cd5fc5a8b 100644 --- a/config/initializers/dartsass.rb +++ b/config/initializers/dartsass.rb @@ -3,7 +3,6 @@ "components/_back-to-top.scss" => "components/_back-to-top.css", "components/_banner.scss" => "components/_banner.css", "components/_contents-list-with-body.scss" => "components/_contents-list-with-body.css", - "components/_download-link.scss" => "components/_download-link.css", "components/_figure.scss" => "components/_figure.css", "components/_published-dates.scss" => "components/_published-dates.css", "views/_guide.scss" => "views/_guide.css", diff --git a/test/components/download_link_test.rb b/test/components/download_link_test.rb deleted file mode 100644 index 19670fce5..000000000 --- a/test/components/download_link_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -require "component_test_helper" - -class DownloadLinkTest < ComponentTestCase - def component_name - "download_link" - end - - test "fails to render a download link when no href is given" do - assert_raise do - render_component({}) - end - end - - test "renders a download link correctly" do - render_component(href: "/download-me") - assert_select ".app-c-download-link[href=\"/download-me\"]" - end - - test "renders a download link with custom link text correctly" do - render_component(href: "/download-map", link_text: "Download this file") - assert_select ".app-c-download-link[href=\"/download-map\"]", text: "Download this file" - end -end diff --git a/test/integration/travel_advice_test.rb b/test/integration/travel_advice_test.rb index 34fe84be1..5d3476b31 100644 --- a/test/integration/travel_advice_test.rb +++ b/test/integration/travel_advice_test.rb @@ -41,7 +41,7 @@ class TravelAdviceTest < ActionDispatch::IntegrationTest end assert page.has_css?(".map img[src=\"#{@content_item['details']['image']['url']}\"]") - assert page.has_css?(".map figcaption a[href=\"#{@content_item['details']['document']['url']}\"]", text: "Download a more detailed map (PDF)") + assert page.has_css?(".map__link a[href=\"#{@content_item['details']['document']['url']}\"]", text: "Download a more detailed map") end test "travel advice part renders just that part" do