Skip to content

Commit

Permalink
fix missing tooltip on hover of X button while edit message
Browse files Browse the repository at this point in the history
  • Loading branch information
situchan committed Jun 27, 2023
1 parent 82558a1 commit 5647eab
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import * as ComposerUtils from '../../../libs/ComposerUtils';
import * as ComposerActions from '../../../libs/actions/Composer';
import * as User from '../../../libs/actions/User';
import PressableWithFeedback from '../../../components/Pressable/PressableWithFeedback';
import Hoverable from '../../../components/Hoverable';
import getButtonState from '../../../libs/getButtonState';
import useLocalize from '../../../hooks/useLocalize';
import useKeyboardState from '../../../hooks/useKeyboardState';
import useWindowDimensions from '../../../hooks/useWindowDimensions';
Expand Down Expand Up @@ -255,27 +255,25 @@ function ReportActionItemMessageEdit(props) {
<View style={[styles.chatItemMessage, styles.flexRow]}>
<View style={[styles.justifyContentEnd]}>
<Tooltip text={translate('common.cancel')}>
<Hoverable>
{(hovered) => (
<PressableWithFeedback
onPress={deleteDraft}
style={styles.chatItemSubmitButton}
nativeID={cancelButtonID}
accessibilityRole="button"
accessibilityLabel={translate('common.close')}
// disable dimming
hoverDimmingValue={1}
pressDimmingValue={1}
hoverStyle={StyleUtils.getButtonBackgroundColorStyle(CONST.BUTTON_STATES.ACTIVE)}
pressStyle={StyleUtils.getButtonBackgroundColorStyle(CONST.BUTTON_STATES.PRESSED)}
>
<Icon
src={Expensicons.Close}
fill={StyleUtils.getIconFillColor(hovered ? CONST.BUTTON_STATES.ACTIVE : CONST.BUTTON_STATES.DEFAULT)}
/>
</PressableWithFeedback>
<PressableWithFeedback
onPress={deleteDraft}
style={styles.chatItemSubmitButton}
nativeID={cancelButtonID}
accessibilityRole="button"
accessibilityLabel={translate('common.close')}
// disable dimming
hoverDimmingValue={1}
pressDimmingValue={1}
hoverStyle={StyleUtils.getButtonBackgroundColorStyle(CONST.BUTTON_STATES.ACTIVE)}
pressStyle={StyleUtils.getButtonBackgroundColorStyle(CONST.BUTTON_STATES.PRESSED)}
>
{({hovered, pressed}) => (
<Icon
src={Expensicons.Close}
fill={StyleUtils.getIconFillColor(getButtonState(hovered, pressed))}
/>
)}
</Hoverable>
</PressableWithFeedback>
</Tooltip>
</View>
<View
Expand Down

0 comments on commit 5647eab

Please sign in to comment.