app/helpers/components/toast_helper.rb in shadcn-ui-0.0.4 vs app/helpers/components/toast_helper.rb in shadcn-ui-0.0.5
- old
+ new
@@ -1,5 +1,8 @@
module Components::ToastHelper
- def render_toast(header: nil, description: nil, action: nil, class: nil, data: nil, **options, &block)
+ def render_toast(header: nil, description: nil, action: nil, class: nil, data: {}, variant: :default, **options, &block)
+ options[:class] ||= ""
+ options[:class] << " destructive group border-destructive bg-destructive text-destructive-foreground " if variant == :destructive
+
render "components/ui/toast", header:, description:, action:, class:, data:, options: options
end
end