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

Edit Message Box Style Fixes #29059

Merged
merged 5 commits into from
Oct 10, 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
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 @@ -313,30 +311,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 @@ -346,7 +320,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
Loading