app/helpers/coco/app_helper.rb in coveragebook_components-0.9.1 vs app/helpers/coco/app_helper.rb in coveragebook_components-0.10.0
- old
+ new
@@ -66,9 +66,26 @@
def coco_seamless_textarea(**, &block)
render Coco::App::Elements::SeamlessTextarea.new(**), &block
end
+ def coco_stamp(type = nil, **)
+ props = case type
+ when :success, :positive
+ {icon: :check_circle, theme: :positive}
+ when :error, :negative
+ {icon: :alert_circle, theme: :negative}
+ when :warning
+ {icon: :alert_triangle, theme: :warning}
+ when :info
+ {icon: :info, theme: :info}
+ else
+ {}
+ end
+
+ render Coco::App::Elements::Stamp.new(**props, **)
+ end
+
def coco_snackbar(**, &block)
render Coco::App::Elements::Snackbar.new(**), &block
end
def coco_notice(**, &block)