app/components/coco/messaging/notice/notice.rb in coveragebook_components-0.17.2 vs app/components/coco/messaging/notice/notice.rb in coveragebook_components-0.17.3
- old
+ new
@@ -12,7 +12,15 @@
%i[title action secondary_action link].each do |slot_name|
renders_one slot_name, ->(*args, **kwargs, &block) do
alert.send(:"with_#{slot_name}", *args, **kwargs, &block)
end
end
+
+ before_render do
+ with_title { @title } unless title?
+ end
+
+ def initialize(title: nil, **kwargs)
+ @title = title
+ end
end
end