From 22223372ace8e1dafd433ea16428902222677d58 Mon Sep 17 00:00:00 2001 From: Robert Kozik Date: Thu, 25 May 2023 12:26:33 +0200 Subject: [PATCH] migrate ReportActionCompose to PressableWithFeedback --- src/pages/home/report/ReportActionCompose.js | 33 +++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index c789b03ab0b9..0c25659d1776 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {View, TouchableOpacity, InteractionManager, LayoutAnimation, NativeModules, findNodeHandle} from 'react-native'; +import {View, InteractionManager, LayoutAnimation, NativeModules, findNodeHandle} from 'react-native'; import _ from 'underscore'; import lodashGet from 'lodash/get'; import {withOnyx} from 'react-native-onyx'; @@ -54,6 +54,7 @@ import * as Welcome from '../../../libs/actions/Welcome'; import Permissions from '../../../libs/Permissions'; import * as TaskUtils from '../../../libs/actions/Task'; import * as Browser from '../../../libs/Browser'; +import PressableWithFeedback from '../../../components/Pressable/PressableWithFeedback'; const propTypes = { /** Beta features list */ @@ -962,7 +963,7 @@ class ReportActionCompose extends React.Component { > {this.props.isComposerFullSize && ( - { e.preventDefault(); this.setShouldShowSuggestionMenuToFalse(); @@ -972,14 +973,16 @@ class ReportActionCompose extends React.Component { onMouseDown={(e) => e.preventDefault()} style={styles.composerSizeButton} disabled={isBlockedFromConcierge || this.props.disabled} + accessibilityRole="button" + accessibilityLabel={this.props.translate('reportActionCompose.collapse')} > - + )} {!this.props.isComposerFullSize && isFullComposerAvailable && ( - { e.preventDefault(); this.setShouldShowSuggestionMenuToFalse(); @@ -989,13 +992,15 @@ class ReportActionCompose extends React.Component { onMouseDown={(e) => e.preventDefault()} style={styles.composerSizeButton} disabled={isBlockedFromConcierge || this.props.disabled} + accessibilityRole="button" + accessibilityLabel={this.props.translate('reportActionCompose.expand')} > - + )} - (this.actionButton = el)} onPress={(e) => { e.preventDefault(); @@ -1006,9 +1011,11 @@ class ReportActionCompose extends React.Component { }} style={styles.composerSizeButton} disabled={isBlockedFromConcierge || this.props.disabled} + accessibilityRole="button" + accessibilityLabel={this.props.translate('reportActionCompose.addAction')} > - + e.preventDefault()} > - - +