From c6a9148e20d9041df6860a8fad66e7397f5562b3 Mon Sep 17 00:00:00 2001 From: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:50:44 +0800 Subject: [PATCH] [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> --- src/quo2/components/icon.cljs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/quo2/components/icon.cljs b/src/quo2/components/icon.cljs index a01ab3263d..c703ba880c 100644 --- a/src/quo2/components/icon.cljs +++ b/src/quo2/components/icon.cljs @@ -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