|
1 | 1 | import {Str} from 'expensify-common';
|
2 | 2 | import React, {useCallback} from 'react';
|
3 | 3 | import {View} from 'react-native';
|
4 |
| -import {useOnyx} from 'react-native-onyx'; |
5 | 4 | import {FallbackAvatar} from '@components/Icon/Expensicons';
|
6 | 5 | import MultipleAvatars from '@components/MultipleAvatars';
|
7 | 6 | import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
|
8 |
| -import {useProductTrainingContext} from '@components/ProductTrainingContext'; |
9 | 7 | import SelectCircle from '@components/SelectCircle';
|
10 | 8 | import SubscriptAvatar from '@components/SubscriptAvatar';
|
11 | 9 | import Text from '@components/Text';
|
12 | 10 | import TextWithTooltip from '@components/TextWithTooltip';
|
13 |
| -import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; |
14 | 11 | import useLocalize from '@hooks/useLocalize';
|
15 | 12 | import useStyleUtils from '@hooks/useStyleUtils';
|
16 | 13 | import useTheme from '@hooks/useTheme';
|
17 | 14 | import useThemeStyles from '@hooks/useThemeStyles';
|
18 |
| -import {getIsUserSubmittedExpenseOrScannedReceipt, isSelectedManagerMcTest} from '@libs/OptionsListUtils'; |
19 |
| -import Permissions from '@libs/Permissions'; |
20 | 15 | import CONST from '@src/CONST';
|
21 |
| -import ONYXKEYS from '@src/ONYXKEYS'; |
22 | 16 | import type {Icon} from '@src/types/onyx/OnyxCommon';
|
23 | 17 | import BaseListItem from './BaseListItem';
|
24 | 18 | import type {InviteMemberListItemProps, ListItem} from './types';
|
@@ -48,11 +42,6 @@ function InviteMemberListItem<TItem extends ListItem>({
|
48 | 42 | const theme = useTheme();
|
49 | 43 | const StyleUtils = useStyleUtils();
|
50 | 44 | const {translate} = useLocalize();
|
51 |
| - const [betas] = useOnyx(ONYXKEYS.BETAS); |
52 |
| - const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip} = useProductTrainingContext( |
53 |
| - CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP_MANAGER, |
54 |
| - !getIsUserSubmittedExpenseOrScannedReceipt() && Permissions.canUseManagerMcTest(betas) && isSelectedManagerMcTest(item.login), |
55 |
| - ); |
56 | 45 |
|
57 | 46 | const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;
|
58 | 47 | const subscriptAvatarBorderColor = isFocused ? focusedBackgroundColor : theme.sidebar;
|
@@ -95,75 +84,64 @@ function InviteMemberListItem<TItem extends ListItem>({
|
95 | 84 | shouldDisplayRBR={!shouldShowCheckBox}
|
96 | 85 | >
|
97 | 86 | {(hovered?: boolean) => (
|
98 |
| - <EducationalTooltip |
99 |
| - shouldRender={shouldShowProductTrainingTooltip} |
100 |
| - renderTooltipContent={renderProductTrainingTooltip} |
101 |
| - anchorAlignment={{ |
102 |
| - horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, |
103 |
| - vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, |
104 |
| - }} |
105 |
| - shouldHideOnNavigate |
106 |
| - wrapperStyle={styles.productTrainingTooltipWrapper} |
107 |
| - > |
108 |
| - <View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}> |
109 |
| - {!!item.icons && |
110 |
| - (item.shouldShowSubscript ? ( |
111 |
| - <SubscriptAvatar |
112 |
| - mainAvatar={item.icons.at(0) ?? fallbackIcon} |
113 |
| - secondaryAvatar={item.icons.at(1)} |
114 |
| - showTooltip={showTooltip} |
115 |
| - backgroundColor={hovered && !isFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor} |
116 |
| - /> |
117 |
| - ) : ( |
118 |
| - <MultipleAvatars |
119 |
| - icons={item.icons} |
120 |
| - shouldShowTooltip={showTooltip} |
121 |
| - secondAvatarStyle={[ |
122 |
| - StyleUtils.getBackgroundAndBorderStyle(theme.sidebar), |
123 |
| - isFocused ? StyleUtils.getBackgroundAndBorderStyle(focusedBackgroundColor) : undefined, |
124 |
| - hovered && !isFocused ? StyleUtils.getBackgroundAndBorderStyle(hoveredBackgroundColor) : undefined, |
125 |
| - ]} |
126 |
| - /> |
127 |
| - ))} |
128 |
| - <View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch, styles.optionRow]}> |
129 |
| - <View style={[styles.flexRow, styles.alignItemsCenter]}> |
130 |
| - <TextWithTooltip |
131 |
| - shouldShowTooltip={showTooltip} |
132 |
| - text={Str.removeSMSDomain(item.text ?? '')} |
133 |
| - style={[ |
134 |
| - styles.optionDisplayName, |
135 |
| - isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText, |
136 |
| - item.isBold !== false && styles.sidebarLinkTextBold, |
137 |
| - styles.pre, |
138 |
| - item.alternateText ? styles.mb1 : null, |
139 |
| - ]} |
140 |
| - /> |
141 |
| - </View> |
142 |
| - {!!item.alternateText && ( |
143 |
| - <TextWithTooltip |
144 |
| - shouldShowTooltip={showTooltip} |
145 |
| - text={Str.removeSMSDomain(item.alternateText ?? '')} |
146 |
| - style={[styles.textLabelSupporting, styles.lh16, styles.pre]} |
147 |
| - /> |
148 |
| - )} |
| 87 | + <> |
| 88 | + {!!item.icons && |
| 89 | + (item.shouldShowSubscript ? ( |
| 90 | + <SubscriptAvatar |
| 91 | + mainAvatar={item.icons.at(0) ?? fallbackIcon} |
| 92 | + secondaryAvatar={item.icons.at(1)} |
| 93 | + showTooltip={showTooltip} |
| 94 | + backgroundColor={hovered && !isFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor} |
| 95 | + /> |
| 96 | + ) : ( |
| 97 | + <MultipleAvatars |
| 98 | + icons={item.icons} |
| 99 | + shouldShowTooltip={showTooltip} |
| 100 | + secondAvatarStyle={[ |
| 101 | + StyleUtils.getBackgroundAndBorderStyle(theme.sidebar), |
| 102 | + isFocused ? StyleUtils.getBackgroundAndBorderStyle(focusedBackgroundColor) : undefined, |
| 103 | + hovered && !isFocused ? StyleUtils.getBackgroundAndBorderStyle(hoveredBackgroundColor) : undefined, |
| 104 | + ]} |
| 105 | + /> |
| 106 | + ))} |
| 107 | + <View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch, styles.optionRow]}> |
| 108 | + <View style={[styles.flexRow, styles.alignItemsCenter]}> |
| 109 | + <TextWithTooltip |
| 110 | + shouldShowTooltip={showTooltip} |
| 111 | + text={Str.removeSMSDomain(item.text ?? '')} |
| 112 | + style={[ |
| 113 | + styles.optionDisplayName, |
| 114 | + isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText, |
| 115 | + item.isBold !== false && styles.sidebarLinkTextBold, |
| 116 | + styles.pre, |
| 117 | + item.alternateText ? styles.mb1 : null, |
| 118 | + ]} |
| 119 | + /> |
149 | 120 | </View>
|
150 |
| - {!!item.rightElement && item.rightElement} |
151 |
| - {!!shouldShowCheckBox && ( |
152 |
| - <PressableWithFeedback |
153 |
| - onPress={handleCheckboxPress} |
154 |
| - disabled={isDisabled} |
155 |
| - role={CONST.ROLE.BUTTON} |
156 |
| - accessibilityLabel={item.text ?? ''} |
157 |
| - style={[styles.ml2, styles.optionSelectCircle]} |
158 |
| - > |
159 |
| - <SelectCircle |
160 |
| - isChecked={item.isSelected ?? false} |
161 |
| - selectCircleStyles={styles.ml0} |
162 |
| - /> |
163 |
| - </PressableWithFeedback> |
| 121 | + {!!item.alternateText && ( |
| 122 | + <TextWithTooltip |
| 123 | + shouldShowTooltip={showTooltip} |
| 124 | + text={Str.removeSMSDomain(item.alternateText ?? '')} |
| 125 | + style={[styles.textLabelSupporting, styles.lh16, styles.pre]} |
| 126 | + /> |
164 | 127 | )}
|
165 | 128 | </View>
|
166 |
| - </EducationalTooltip> |
| 129 | + {!!item.rightElement && item.rightElement} |
| 130 | + {!!shouldShowCheckBox && ( |
| 131 | + <PressableWithFeedback |
| 132 | + onPress={handleCheckboxPress} |
| 133 | + disabled={isDisabled} |
| 134 | + role={CONST.ROLE.BUTTON} |
| 135 | + accessibilityLabel={item.text ?? ''} |
| 136 | + style={[styles.ml2, styles.optionSelectCircle]} |
| 137 | + > |
| 138 | + <SelectCircle |
| 139 | + isChecked={item.isSelected ?? false} |
| 140 | + selectCircleStyles={styles.ml0} |
| 141 | + /> |
| 142 | + </PressableWithFeedback> |
| 143 | + )} |
| 144 | + </> |
167 | 145 | )}
|
168 | 146 | </BaseListItem>
|
169 | 147 | );
|
|
0 commit comments