Skip to content

Commit

Permalink
Merge pull request #52273 from MuaazArshad/backgroundstyle
Browse files Browse the repository at this point in the history
[CP Staging] Updated Background Color Condition

(cherry picked from commit 2e34a2e)

(CP triggered by Julesssss)
  • Loading branch information
Julesssss authored and OSBotify committed Nov 11, 2024
1 parent e867132 commit 08fae8d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/styles/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1119,13 +1119,18 @@ 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;

if (isDisabled) {
backgroundColor = undefined;
} else if (isSelected) {
if (isSelected) {
backgroundColor = selectedBG;
} else if (isDisabled) {
backgroundColor = undefined;
} else if (isFocused) {
backgroundColor = focusedBG;
}
Expand Down

0 comments on commit 08fae8d

Please sign in to comment.