From ac5d84eb71322a0eace1d4a92f8a75b7283e325a Mon Sep 17 00:00:00 2001 From: IHowarth-Improving <99996377+IHowarth-Improving@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:14:23 -0600 Subject: [PATCH] Fixing left icon to use specified field instead of being hardcoded to 'image' Using 'iconField' for left icon in Select Country Initially changed this to also use 'imageValue', as that seems to be the most obvious case but why not allow for more freedom. --- src/components/SelectCountry/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SelectCountry/index.tsx b/src/components/SelectCountry/index.tsx index fc7c335..3b7680b 100644 --- a/src/components/SelectCountry/index.tsx +++ b/src/components/SelectCountry/index.tsx @@ -20,6 +20,7 @@ const SelectCountryComponent: ( valueField, labelField, imageField, + iconField, selectedTextStyle, imageStyle, } = props; @@ -59,10 +60,10 @@ const SelectCountryComponent: ( {...props} renderItem={_renderItem} renderLeftIcon={() => { - if (selectItem?.image) { + if (selectItem && selectItem[iconField]) { return ( );