feedback PR Colin

This commit is contained in:
Lisa Durand 2023-06-29 13:53:23 +02:00
parent e03696c380
commit 0a0665bb4d
4 changed files with 11 additions and 13 deletions

View file

@ -13,11 +13,11 @@ class Dsfr::AlertComponent < ApplicationComponent
end
def alert_class(state)
if size == 'small'
["fr-alert fr-alert--sm fr-alert--#{state}", extra_class_names].compact.flatten
else
["fr-alert fr-alert--#{state}", extra_class_names].compact.flatten
end
class_names(
"fr-alert fr-alert--#{state}" => true,
"fr-alert--sm" => size == :sm,
extra_class_names => true
)
end
private

View file

@ -1,5 +1,5 @@
%div{ class: alert_class(state) }
- if size != 'small'
- if size != :sm
= content_tag(heading_level, class: 'fr-alert__title') do
= "#{prefix_for_state}#{title}"
= body