Skip to content

Commit

Permalink
Merge pull request #18137 from hungvu193/fix-17912
Browse files Browse the repository at this point in the history
Fix GBR and RBR show up at the same time in the LHN
  • Loading branch information
luacmartins authored May 2, 2023
2 parents ac3f3c4 + 688ba8e commit c9f6606
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ const OptionRowLHN = (props) => {
const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;

const avatarTooltips = !optionItem.isChatRoom && !optionItem.isArchivedRoom ? _.pluck(optionItem.displayNamesWithTooltips, 'tooltip') : undefined;
const shouldShowGreenDotIndicator = optionItem.isUnreadWithMention || (optionItem.hasOutstandingIOU && !optionItem.isIOUReportOwner);
const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
const shouldShowGreenDotIndicator = !hasBrickError && (optionItem.isUnreadWithMention || (optionItem.hasOutstandingIOU && !optionItem.isIOUReportOwner));

return (
<OfflineWithFeedback
Expand Down Expand Up @@ -201,13 +202,13 @@ const OptionRowLHN = (props) => {
</Text>
</View>
) : null}
{optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && (
{hasBrickError && (
<View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>
<Icon
src={Expensicons.DotIndicator}
fill={colors.red}
height={variables.iconSizeSmall}
width={variables.iconSizeSmall}
height={variables.iconSizeNormal}
width={variables.iconSizeNormal}
/>
</View>
)}
Expand All @@ -217,6 +218,14 @@ const OptionRowLHN = (props) => {
style={[styles.flexRow, styles.alignItemsCenter]}
accessible={false}
>
{shouldShowGreenDotIndicator && (
<Icon
height={variables.iconSizeNormal}
width={variables.iconSizeNormal}
src={Expensicons.DotIndicator}
fill={colors.green}
/>
)}
{optionItem.hasDraftComment && (
<View
style={styles.ml2}
Expand All @@ -225,8 +234,7 @@ const OptionRowLHN = (props) => {
<Icon src={Expensicons.Pencil} height={16} width={16} />
</View>
)}
{shouldShowGreenDotIndicator && <Icon src={Expensicons.DotIndicator} fill={themeColors.success} />}
{optionItem.isPinned && (
{!shouldShowGreenDotIndicator && optionItem.isPinned && (
<View
style={styles.ml2}
accessibilityLabel={props.translate('sidebarScreen.chatPinned')}
Expand Down

0 comments on commit c9f6606

Please sign in to comment.