Skip to content

Commit

Permalink
removed border_class from component; border_color can now be interpol…
Browse files Browse the repository at this point in the history
…ated directly within the html class
  • Loading branch information
sarahcrack committed Jan 6, 2025
1 parent 93e9ca6 commit 5a95937
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/content/results_box_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= title %>
</div>
<% end %>
<section class="results-box <%= border_class %>">
<section class="results-box results-box--<%= border_color %>">
<h2 class="results-box__heading">
<%= heading %>
</h2>
Expand Down
6 changes: 1 addition & 5 deletions app/components/content/results_box_component.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Content
class ResultsBoxComponent < ViewComponent::Base
attr_reader :title, :heading, :fee, :course_length, :funding, :text, :link_text, :link_target, :border_color, :show_title
attr_reader :title, :heading, :fee, :course_length, :funding, :text, :link_text, :link_target, :border_color

include ContentHelper

Expand All @@ -17,9 +17,5 @@ def initialize(heading:, fee:, course_length:, funding:, text:, link_text:, link
@link_target = link_target
@border_color = border_color
end

def border_class
@border_color == :yellow ? "results-box--yellow" : "results-box--grey"
end
end
end

0 comments on commit 5a95937

Please sign in to comment.