From 04c3a7ca574a4f97b9ff8a37dcd6aa840842ac1f Mon Sep 17 00:00:00 2001 From: Robert Kozik Date: Tue, 13 Jun 2023 13:12:24 +0200 Subject: [PATCH 1/2] migrate PinButton to PressableWithoutFeedback --- src/components/PinButton.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/PinButton.js b/src/components/PinButton.js index 00d9ae3a6077..a2c1396a8d2e 100644 --- a/src/components/PinButton.js +++ b/src/components/PinButton.js @@ -1,5 +1,4 @@ import React from 'react'; -import {Pressable} from 'react-native'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import Icon from './Icon'; @@ -9,6 +8,7 @@ import reportPropTypes from '../pages/reportPropTypes'; import * as Report from '../libs/actions/Report'; import * as Expensicons from './Icon/Expensicons'; import * as Session from '../libs/actions/Session'; +import PressableWithFeedback from './Pressable/PressableWithFeedback'; const propTypes = { /** Report to pin */ @@ -22,15 +22,18 @@ const defaultProps = { const PinButton = (props) => ( - Report.togglePinnedState(props.report.reportID, props.report.isPinned))} style={[styles.touchableButtonImage]} + accessibilityState={{checked: props.report.isPinned}} + accessibilityLabel={props.report.isPinned ? props.translate('common.unPin') : props.translate('common.pin')} + accessibilityRole="button" > - + ); From aa9d332479252b273825a611b010e9138b0aadbd Mon Sep 17 00:00:00 2001 From: Robert Kozik Date: Thu, 15 Jun 2023 14:48:53 +0200 Subject: [PATCH 2/2] prettier on PinButton --- src/components/PinButton.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/PinButton.js b/src/components/PinButton.js index 87aa8ab8afc8..800e0a828d1d 100644 --- a/src/components/PinButton.js +++ b/src/components/PinButton.js @@ -24,17 +24,17 @@ function PinButton(props) { return ( Report.togglePinnedState(props.report.reportID, props.report.isPinned))} - style={[styles.touchableButtonImage]} - accessibilityState={{checked: props.report.isPinned}} - accessibilityLabel={props.report.isPinned ? props.translate('common.unPin') : props.translate('common.pin')} - accessibilityRole="button" - > - - + onPress={Session.checkIfActionIsAllowed(() => Report.togglePinnedState(props.report.reportID, props.report.isPinned))} + style={[styles.touchableButtonImage]} + accessibilityState={{checked: props.report.isPinned}} + accessibilityLabel={props.report.isPinned ? props.translate('common.unPin') : props.translate('common.pin')} + accessibilityRole="button" + > + + ); }