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

remove PressableWithFeedback wrap button choose file and give permission #28245

Merged
Merged
Show file tree
Hide file tree
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
31 changes: 13 additions & 18 deletions src/pages/iou/ReceiptSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as IOU from '../../../libs/actions/IOU';
import reportPropTypes from '../../reportPropTypes';
import CONST from '../../../CONST';
import ReceiptUpload from '../../../../assets/images/receipt-upload.svg';
import PressableWithFeedback from '../../../components/Pressable/PressableWithFeedback';
import Button from '../../../components/Button';
import styles from '../../../styles/styles';
import CopyTextToClipboard from '../../../components/CopyTextToClipboard';
Expand Down Expand Up @@ -155,24 +154,20 @@ function ReceiptSelector(props) {
</Text>
<AttachmentPicker>
{({openPicker}) => (
<PressableWithFeedback
<Button
medium
success
text={translate('receipt.chooseFile')}
accessibilityLabel={translate('receipt.chooseFile')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
>
<Button
medium
success
text={translate('receipt.chooseFile')}
style={[styles.p9]}
onPress={() => {
openPicker({
onPicked: (file) => {
setReceiptAndNavigate(file, props.iou, props.report);
},
});
}}
/>
</PressableWithFeedback>
style={[styles.p9]}
onPress={() => {
openPicker({
onPicked: (file) => {
setReceiptAndNavigate(file, props.iou, props.report);
},
});
}}
/>
)}
</AttachmentPicker>
</>
Expand Down
18 changes: 7 additions & 11 deletions src/pages/iou/ReceiptSelector/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,14 @@ function ReceiptSelector({route, report, iou, transactionID, isInTabNavigator})
/>
<Text style={[styles.textReceiptUpload]}>{translate('receipt.takePhoto')}</Text>
<Text style={[styles.subTextReceiptUpload]}>{translate('receipt.cameraAccess')}</Text>
<PressableWithFeedback
<Button
medium
success
text={translate('receipt.givePermission')}
accessibilityLabel={translate('receipt.givePermission')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
>
<Button
medium
success
text={translate('receipt.givePermission')}
style={[styles.p9, styles.pt5]}
onPress={askForPermissions}
/>
</PressableWithFeedback>
style={[styles.p9, styles.pt5]}
onPress={askForPermissions}
/>
</View>
)}
{permissions === RESULTS.GRANTED && device == null && (
Expand Down