[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}
|
^{:key icon-name}
|
||||||
(if-let [svg-icon (icons.svg/get-icon icon-name size)]
|
(if-let [svg-icon (icons.svg/get-icon icon-name size)]
|
||||||
[svg-icon
|
[svg-icon
|
||||||
{:size size
|
(cond-> {:size size
|
||||||
:color (when (valid-color? color) color)
|
:accessibility-label accessibility-label
|
||||||
:color-2 (when (valid-color? color-2) color-2)
|
:style container-style}
|
||||||
: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
|
[rn/image
|
||||||
{:style
|
{:style
|
||||||
(merge {:width size
|
(merge {:width size
|
||||||
|
|
Loading…
Reference in New Issue