Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing tooltip on hover of X button while edit message #21764

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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