Skip to content

Commit

Permalink
Merge pull request #28245 from namhihi237/fix-26993-choose-file-butto…
Browse files Browse the repository at this point in the history
…n-pressable
  • Loading branch information
dangrous authored Sep 27, 2023
2 parents 6263b7b + 4f78ad1 commit 4b0db94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
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

0 comments on commit 4b0db94

Please sign in to comment.