[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:
Mohamed Javid 2023-10-07 15:50:44 +08:00 committed by GitHub
parent 7c1850b901
commit c6a9148e20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -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