Skip to content

Commit

Permalink
Fix(web-twig): Add missing icon colors key-pairs for Alert component
Browse files Browse the repository at this point in the history
refs #DS-619
  • Loading branch information
literat committed Feb 16, 2023
1 parent 4d58d30 commit adac3d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 6 additions & 1 deletion packages/web-twig/src/Resources/components/Alert/Alert.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
{# Miscellaneous #}
{%- set _classNames = [ _rootClassName, _colorClassName, _rootCenteredClassName, _class ] -%}
{%- set _iconNameByColor = 'info' -%}
{% if _color == 'danger' %}
{% if _color == 'success' %}
{%- set _iconNameByColor = 'check-plain' -%}
{% elseif _color == 'warning' %}
{%- set _iconNameByColor = 'warning' -%}
{% elseif _color == 'danger' %}
{%- set _iconNameByColor = 'warning' -%}
{% endif %}

{%- set _iconNameValue = _iconName | default(_iconNameByColor) -%}

<{{ _elementType }} {{ mainProps(props) }} {{ classProp(_classNames) }} role="alert">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<html><body>
<div class="Alert Alert--success" role="alert">

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="71b5e17370f608a6d61d19a2af18fcf8" aria-hidden="true">
<path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM13 17H11V11H13V17ZM13 9H11V7H13V9Z" fill="#132930"></path>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="5d48819be09fb69b6b7c8466305864f2" aria-hidden="true">
<path d="M9.00012 16.5447L5.50012 13.0447C5.11012 12.6547 4.49012 12.6547 4.10012 13.0447C3.71012 13.4347 3.71012 14.0547 4.10012 14.4447L8.29012 18.6347C8.68012 19.0247 9.31012 19.0247 9.70012 18.6347L20.3001 8.04473C20.6901 7.65473 20.6901 7.03473 20.3001 6.64473C19.9101 6.25473 19.2901 6.25473 18.9001 6.64473L9.00012 16.5447Z" fill="#132930"></path>
</svg>

<div> Message
Expand All @@ -19,14 +19,16 @@
</div>
<div class="Alert Alert--informative" role="alert">

<svg width="24" height="24" fill="none" viewbox="0 0 24 24" aria-hidden="true"><use href="#71b5e17370f608a6d61d19a2af18fcf8"></use></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="71b5e17370f608a6d61d19a2af18fcf8" aria-hidden="true">
<path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM13 17H11V11H13V17ZM13 9H11V7H13V9Z" fill="#132930"></path>
</svg>

<div> Message
</div>
</div>
<div class="Alert Alert--warning" role="alert">

<svg width="24" height="24" fill="none" viewbox="0 0 24 24" aria-hidden="true"><use href="#71b5e17370f608a6d61d19a2af18fcf8"></use></svg>
<svg width="24" height="24" fill="none" viewbox="0 0 24 24" aria-hidden="true"><use href="#88caaf10a3fadcfb2dac0683f0b6a278"></use></svg>

<div> Message
</div>
Expand Down

0 comments on commit adac3d9

Please sign in to comment.