Skip to content

Commit

Permalink
Merge pull request #29059 from neonbhai/EditMessageBoxStyleFixes
Browse files Browse the repository at this point in the history
Edit Message Box Style Fixes
  • Loading branch information
luacmartins authored Oct 10, 2023
2 parents c68bf6a + 20b369b commit 708794c
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Str from 'expensify-common/lib/str';
import reportActionPropTypes from './reportActionPropTypes';
import styles from '../../../styles/styles';
import themeColors from '../../../styles/themes/default';
import * as StyleUtils from '../../../styles/StyleUtils';
import containerComposeStyles from '../../../styles/containerComposeStyles';
import Composer from '../../../components/Composer';
import * as Report from '../../../libs/actions/Report';
Expand All @@ -29,7 +28,6 @@ import refPropTypes from '../../../components/refPropTypes';
import * as ComposerUtils from '../../../libs/ComposerUtils';
import * as User from '../../../libs/actions/User';
import PressableWithFeedback from '../../../components/Pressable/PressableWithFeedback';
import getButtonState from '../../../libs/getButtonState';
import useLocalize from '../../../hooks/useLocalize';
import useKeyboardState from '../../../hooks/useKeyboardState';
import useWindowDimensions from '../../../hooks/useWindowDimensions';
Expand Down Expand Up @@ -323,30 +321,6 @@ function ReportActionItemMessageEdit(props) {
return (
<>
<View style={[styles.chatItemMessage, styles.flexRow]}>
<View style={[styles.justifyContentEnd]}>
<Tooltip text={translate('common.cancel')}>
<PressableWithFeedback
onPress={deleteDraft}
style={styles.chatItemSubmitButton}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.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)}
// Keep focus on the composer when cancel button is clicked.
onMouseDown={(e) => e.preventDefault()}
>
{({hovered, pressed}) => (
<Icon
src={Expensicons.Close}
fill={StyleUtils.getIconFillColor(getButtonState(hovered, pressed))}
/>
)}
</PressableWithFeedback>
</Tooltip>
</View>
<View
style={[
isFocused ? styles.chatItemComposeBoxFocusedColor : styles.chatItemComposeBoxColor,
Expand All @@ -356,7 +330,24 @@ function ReportActionItemMessageEdit(props) {
hasExceededMaxCommentLength && styles.borderColorDanger,
]}
>
<View style={containerComposeStyles}>
<View style={[styles.justifyContentEnd, styles.mb1]}>
<Tooltip text={translate('common.cancel')}>
<PressableWithFeedback
onPress={deleteDraft}
style={styles.composerSizeButton}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
accessibilityLabel={translate('common.close')}
// disable dimming
hoverDimmingValue={1}
pressDimmingValue={1}
// Keep focus on the composer when cancel button is clicked.
onMouseDown={(e) => e.preventDefault()}
>
<Icon src={Expensicons.Close} />
</PressableWithFeedback>
</Tooltip>
</View>
<View style={[containerComposeStyles, styles.textInputComposeBorder]}>
<Composer
multiline
ref={(el) => {
Expand Down

0 comments on commit 708794c

Please sign in to comment.