From 4af6e08ed7f229945ec94d6dcbcdcbc8d9d25a45 Mon Sep 17 00:00:00 2001 From: Muaaz Arshad Date: Fri, 8 Nov 2024 22:57:43 +0500 Subject: [PATCH 1/5] Updated Background Color Condition --- src/styles/utils/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 02778b4ca351..028d89d9ab4d 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1122,10 +1122,10 @@ function getAmountWidth(amount: string): number { function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, isDisabled: boolean, selectedBG: string, focusedBG: string): ViewStyle { let backgroundColor; - if (isDisabled) { - backgroundColor = undefined; - } else if (isSelected) { + if (isSelected) { backgroundColor = selectedBG; + } else if (isDisabled) { + backgroundColor = undefined; } else if (isFocused) { backgroundColor = focusedBG; } From 684234b0777832fd9363a3a01b33e28d1f76676c Mon Sep 17 00:00:00 2001 From: Muaaz Arshad <111155000+MuaazArshad@users.noreply.github.com> Date: Sat, 9 Nov 2024 00:58:26 +0500 Subject: [PATCH 2/5] Added Comments --- src/styles/utils/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 028d89d9ab4d..99adb1b02c0e 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1121,7 +1121,9 @@ function getAmountWidth(amount: string): number { function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, isDisabled: boolean, selectedBG: string, focusedBG: string): ViewStyle { let backgroundColor; - +// When the item is selected and disabled, We want selected item styles. +// When the item is focused and disabled, We want disabled item styles. +// Single true value will give result accordingly. if (isSelected) { backgroundColor = selectedBG; } else if (isDisabled) { From 1553b765d66f36a007031923b852fa6ed0ccce87 Mon Sep 17 00:00:00 2001 From: Muaaz Arshad <111155000+MuaazArshad@users.noreply.github.com> Date: Sat, 9 Nov 2024 01:01:39 +0500 Subject: [PATCH 3/5] Update index.ts --- src/styles/utils/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 99adb1b02c0e..fd4cfde0519b 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1121,9 +1121,11 @@ function getAmountWidth(amount: string): number { function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, isDisabled: boolean, selectedBG: string, focusedBG: string): ViewStyle { let backgroundColor; -// When the item is selected and disabled, We want selected item styles. -// When the item is focused and disabled, We want disabled item styles. -// Single true value will give result accordingly. +/** +* When the item is selected and disabled, We want selected item styles. +* When the item is focused and disabled, We want disabled item styles. +* Single true value will give result accordingly. +*/ if (isSelected) { backgroundColor = selectedBG; } else if (isDisabled) { From 638f6bb1a76daeaf1cd44b5de84345bce766052d Mon Sep 17 00:00:00 2001 From: Muaaz Arshad Date: Sat, 9 Nov 2024 01:07:26 +0500 Subject: [PATCH 4/5] Added Comments --- src/styles/utils/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index fd4cfde0519b..d73857703281 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1119,13 +1119,14 @@ function getAmountWidth(amount: string): number { return width; } +/** + * When the item is selected and disabled, We want selected item styles. + * When the item is focused and disabled, We want disabled item styles. + * Single true value will give result accordingly. + */ function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, isDisabled: boolean, selectedBG: string, focusedBG: string): ViewStyle { let backgroundColor; -/** -* When the item is selected and disabled, We want selected item styles. -* When the item is focused and disabled, We want disabled item styles. -* Single true value will give result accordingly. -*/ + if (isSelected) { backgroundColor = selectedBG; } else if (isDisabled) { From 0104fc6e0316997d0c154b5563521cfbeb93ef19 Mon Sep 17 00:00:00 2001 From: Muaaz Arshad <111155000+MuaazArshad@users.noreply.github.com> Date: Sat, 9 Nov 2024 01:55:56 +0500 Subject: [PATCH 5/5] Update src/styles/utils/index.ts Co-authored-by: Carlos Martins --- src/styles/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index d73857703281..881fbc278190 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1120,8 +1120,8 @@ function getAmountWidth(amount: string): number { } /** - * When the item is selected and disabled, We want selected item styles. - * When the item is focused and disabled, We want disabled item styles. + * When the item is selected and disabled, we want selected item styles. + * When the item is focused and disabled, we want disabled item styles. * Single true value will give result accordingly. */ function getItemBackgroundColorStyle(isSelected: boolean, isFocused: boolean, isDisabled: boolean, selectedBG: string, focusedBG: string): ViewStyle {