[Fix] SVG Icon color (#17561)
This commit fixes the "X" mark in the clear icon displayed in inputs and URL preview components by updating the props for "svg-icon" to add the "color" and "color-2" keys only if it's present and valid. Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
7c1850b901
commit
c6a9148e20
|
@ -21,11 +21,15 @@
|
|||
^{:key icon-name}
|
||||
(if-let [svg-icon (icons.svg/get-icon icon-name size)]
|
||||
[svg-icon
|
||||
{:size size
|
||||
:color (when (valid-color? color) color)
|
||||
:color-2 (when (valid-color? color-2) color-2)
|
||||
:accessibility-label accessibility-label
|
||||
:style container-style}]
|
||||
(cond-> {:size size
|
||||
:accessibility-label accessibility-label
|
||||
:style container-style}
|
||||
|
||||
(and color (valid-color? color))
|
||||
(assoc :color color)
|
||||
|
||||
(and color-2 (valid-color? color-2))
|
||||
(assoc :color-2 color-2))]
|
||||
[rn/image
|
||||
{:style
|
||||
(merge {:width size
|
||||
|
|
Loading…
Reference in New Issue