app/components/coco/app/elements/alert/alert.rb in coveragebook_components-0.7.9 vs app/components/coco/app/elements/alert/alert.rb in coveragebook_components-0.7.10
- old
+ new
@@ -23,22 +23,22 @@
accepts_option :theme, from: THEMES, default: "info"
accepts_option :single_line, from: [true, false]
renders_one :title
- renders_one :action, ->(**kwargs, &block) do
+ renders_one :action, ->(*args, **kwargs, &block) do
theme = vivid? ? "neutral-dark" : get_option_value(:theme)
- Coco::App::Elements::Button.new(**kwargs, theme: theme, size: :sm, icon: nil)
+ @action_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
end
- renders_one :secondary_action, ->(**kwargs, &block) do
+ renders_one :secondary_action, ->(*args, **kwargs, &block) do
theme = vivid? ? "neutral-light" : "text-#{get_option_value(:theme)}"
- Coco::App::Elements::Button.new(**kwargs, theme: theme, size: :sm, icon: nil)
+ @secondary_action_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
end
- renders_one :link, ->(**kwargs, &block) do
+ renders_one :link, ->(*args, **kwargs, &block) do
theme = vivid? ? nil : unvividify(get_option_value(:theme))
- Coco::App::Elements::Link.new(**kwargs, theme: theme, size: :sm, icon: nil)
+ @link_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
end
before_render do
theme = get_option_value(:theme)