Skip to content

Commit 106376f

Browse files
A-Wheetomsquance-stem
authored andcommitted
Set default background colour in component constructor and removed method
1 parent 92bf1bd commit 106376f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

app/components/cms/page_title_component.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ def initialize(title:, sub_text: nil, title_image: nil, title_video_url: nil, st
77
@title_image = title_image
88
@title_video_url = title_video_url
99
@status_message = status_message
10-
@background_color = background_color
10+
@background_color = background_color.presence || "lime-green"
1111
@i_belong_flag = i_belong_flag
1212
end
13-
14-
def background_color_class
15-
# Default background color unless specified
16-
return @background_color if @background_color
17-
18-
"lime-green"
19-
end
2013
end

app/components/cms/page_title_component/page_title_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= render GovGridRowComponent.new(background_color: background_color_class, padding: {top: 7, bottom: 7}) do |row| %>
1+
<%= render GovGridRowComponent.new(background_color: @background_color, padding: {top: 7, bottom: 7}) do |row| %>
22
<%= row.with_column("full") do %>
33

44
<div class="page-title__wrapper">

0 commit comments

Comments
 (0)