Skip to content

Commit

Permalink
Further refactor of pf_inline_alert
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Sep 19, 2024
1 parent 7eea817 commit bfdb9b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/helpers/patternfly_components_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ def description_tag(description)
end
end

def pf_inline_alert(title, variant: nil, description: nil, plain: false)
plain_class = plain ? 'pf-m-plain' : ''
def pf_inline_alert(title, **options)
plain_class = options[:plain] ? 'pf-m-plain' : ''
variant = options[:variant]
variant_class = variant ? "pf-m-#{variant}" : ''
classes = "pf-c-alert pf-m-inline #{plain_class} #{variant_class}"
tag.div class: classes do
icon_tag(variant) + title_tag(title) + description_tag(description)
icon_tag(variant) + title_tag(title) + description_tag(options[:description])
end
end
end

0 comments on commit bfdb9b6

Please sign in to comment.