Skip to content

Commit

Permalink
Use component wrapper on summary card component
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Jan 8, 2025
1 parent 0e673b5 commit 4b90b59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

* Use component wrapper on subscription links ([PR #4525](https://github.com/alphagov/govuk_publishing_components/pull/4525))
* Use component wrapper on success alert component ([PR #4527](https://github.com/alphagov/govuk_publishing_components/pull/4527))
* Use component wrapper on summary card component ([PR #4528](https://github.com/alphagov/govuk_publishing_components/pull/4528))

## 47.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

id ||= nil
title ||= nil
data_attributes ||= {}
summary_card_actions ||= []
rows ||=[]

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("gem-c-summary-card")
%>
<% if title || rows.any? %>
<%= tag.div class: "gem-c-summary-card", id: id, data: data_attributes do %>
<%= tag.div(**component_helper.all_attributes) do %>
<%= tag.div class: "govuk-summary-card" do %>
<%= tag.div class: "govuk-summary-card__title-wrapper" do %>
<%= tag.h2 class: "govuk-summary-card__title" do %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ accessibility_criteria: |
- be focusable with a keyboard
- be usable with a keyboard
- indicate when it has focus
uses_component_wrapper_helper: true
examples:
default:
data:
Expand Down

0 comments on commit 4b90b59

Please sign in to comment.