FIX: Restore camera access to mac app

This commit is contained in:
Marcos Rodriguez Velez 2025-02-27 13:18:41 -04:00
parent 2dc26ac26a
commit a0dc0a31e7
5 changed files with 30 additions and 28 deletions

View file

@ -10,7 +10,6 @@ import RNQRGenerator from 'rn-qr-generator';
import { CommonToolTipActions } from '../typings/CommonToolTipActions'; import { CommonToolTipActions } from '../typings/CommonToolTipActions';
import { useSettings } from '../hooks/context/useSettings'; import { useSettings } from '../hooks/context/useSettings';
import { useExtendedNavigation } from '../hooks/useExtendedNavigation'; import { useExtendedNavigation } from '../hooks/useExtendedNavigation';
import { isDesktop } from '../blue_modules/environment';
interface AddressInputScanButtonProps { interface AddressInputScanButtonProps {
isLoading?: boolean; isLoading?: boolean;
@ -146,7 +145,6 @@ export const AddressInputScanButton = ({
testID={testID} testID={testID}
disabled={isLoading} disabled={isLoading}
onPress={toolTipOnPress} onPress={toolTipOnPress}
isMenuPrimaryAction={isDesktop}
buttonStyle={type === 'default' ? buttonStyle : undefined} buttonStyle={type === 'default' ? buttonStyle : undefined}
accessibilityLabel={loc.send.details_scan} accessibilityLabel={loc.send.details_scan}
accessibilityHint={loc.send.details_scan_hint} accessibilityHint={loc.send.details_scan_hint}

View file

@ -5,6 +5,7 @@ import loc from '../loc';
import { Icon } from '@rneui/base'; import { Icon } from '@rneui/base';
import { OnOrientationChangeData, OnReadCodeData } from 'react-native-camera-kit/dist/CameraProps'; import { OnOrientationChangeData, OnReadCodeData } from 'react-native-camera-kit/dist/CameraProps';
import { triggerSelectionHapticFeedback } from '../blue_modules/hapticFeedback'; import { triggerSelectionHapticFeedback } from '../blue_modules/hapticFeedback';
import { isDesktop } from '../blue_modules/environment';
interface CameraScreenProps { interface CameraScreenProps {
onCancelButtonPress: () => void; onCancelButtonPress: () => void;
@ -96,15 +97,17 @@ const CameraScreen: React.FC<CameraScreenProps> = ({
return ( return (
<View style={styles.screen}> <View style={styles.screen}>
<View style={styles.topButtons}> <View style={styles.topButtons}>
<TouchableOpacity style={[styles.topButton, uiRotationStyle, torchMode ? styles.activeTorch : {}]} onPress={onSetTorch}> {!isDesktop && (
<Animated.View style={styles.topButtonImg}> <TouchableOpacity style={[styles.topButton, uiRotationStyle, torchMode ? styles.activeTorch : {}]} onPress={onSetTorch}>
{Platform.OS === 'ios' ? ( <Animated.View style={styles.topButtonImg}>
<Icon name={torchMode ? 'flashlight-on' : 'flashlight-off'} type="font-awesome-6" color={torchMode ? '#000' : '#fff'} /> {Platform.OS === 'ios' ? (
) : ( <Icon name={torchMode ? 'flashlight-on' : 'flashlight-off'} type="font-awesome-6" color={torchMode ? '#000' : '#fff'} />
<Icon name={torchMode ? 'flash-on' : 'flash-off'} type="ionicons" color={torchMode ? '#000' : '#fff'} /> ) : (
)} <Icon name={torchMode ? 'flash-on' : 'flash-off'} type="ionicons" color={torchMode ? '#000' : '#fff'} />
</Animated.View> )}
</TouchableOpacity> </Animated.View>
</TouchableOpacity>
)}
<View style={styles.rightButtonsContainer}> <View style={styles.rightButtonsContainer}>
{showImagePickerButton && ( {showImagePickerButton && (
<TouchableOpacity <TouchableOpacity
@ -154,15 +157,17 @@ const CameraScreen: React.FC<CameraScreenProps> = ({
<TouchableOpacity onPress={onCancelButtonPress}> <TouchableOpacity onPress={onCancelButtonPress}>
<Animated.Text style={[styles.backTextStyle, uiRotationStyle]}>{loc._.cancel}</Animated.Text> <Animated.Text style={[styles.backTextStyle, uiRotationStyle]}>{loc._.cancel}</Animated.Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={[styles.bottomButton, uiRotationStyle]} onPress={onSwitchCameraPressed}> {!isDesktop && (
<Animated.View style={[styles.topButtonImg, uiRotationStyle]}> <TouchableOpacity style={[styles.bottomButton, uiRotationStyle]} onPress={onSwitchCameraPressed}>
{Platform.OS === 'ios' ? ( <Animated.View style={[styles.topButtonImg, uiRotationStyle]}>
<Icon name="cameraswitch" type="font-awesome-6" color="#ffffff" /> {Platform.OS === 'ios' ? (
) : ( <Icon name="cameraswitch" type="font-awesome-6" color="#ffffff" />
<Icon name={cameraType === CameraType.Back ? 'camera-rear' : 'camera-front'} type="ionicons" color="#ffffff" /> ) : (
)} <Icon name={cameraType === CameraType.Back ? 'camera-rear' : 'camera-front'} type="ionicons" color="#ffffff" />
</Animated.View> )}
</TouchableOpacity> </Animated.View>
</TouchableOpacity>
)}
</View> </View>
</View> </View>
); );

View file

@ -1333,7 +1333,7 @@ PODS:
- react-native-tcp-socket (6.2.0): - react-native-tcp-socket (6.2.0):
- CocoaAsyncSocket - CocoaAsyncSocket
- React-Core - React-Core
- react-native-true-sheet (1.1.1): - react-native-true-sheet (2.0.0):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
@ -1819,7 +1819,7 @@ PODS:
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - Yoga
- RNScreens (4.9.0): - RNScreens (4.9.1):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
@ -2266,7 +2266,7 @@ SPEC CHECKSUMS:
react-native-screen-capture: 7b6121f529681ed2fde36cdedadd0bb39e9a3796 react-native-screen-capture: 7b6121f529681ed2fde36cdedadd0bb39e9a3796
react-native-secure-key-store: eb45b44bdec3f48e9be5cdfca0f49ddf64892ea6 react-native-secure-key-store: eb45b44bdec3f48e9be5cdfca0f49ddf64892ea6
react-native-tcp-socket: 61379457d7e702e83e28c213b6e085ac079e480f react-native-tcp-socket: 61379457d7e702e83e28c213b6e085ac079e480f
react-native-true-sheet: 58c0848a4326fd2eb7eedd266ec0f39e7c70e5bd react-native-true-sheet: 15f8d1bfbf2aceca472b9ba585b4116041d20f34
React-nativeconfig: 67fa7a63ea288cb5b1d0dd2deaf240405fec164f React-nativeconfig: 67fa7a63ea288cb5b1d0dd2deaf240405fec164f
React-NativeModulesApple: 34b7a4d7441a4ee78d18109ff107c1ccf7c074a9 React-NativeModulesApple: 34b7a4d7441a4ee78d18109ff107c1ccf7c074a9
React-perflogger: d1149037ac466ad2141d4ae541ca16cb73b2343b React-perflogger: d1149037ac466ad2141d4ae541ca16cb73b2343b
@ -2312,7 +2312,7 @@ SPEC CHECKSUMS:
RNRate: 7641919330e0d6688ad885a985b4bd697ed7d14c RNRate: 7641919330e0d6688ad885a985b4bd697ed7d14c
RNReactNativeHapticFeedback: 00ba111b82aa266bb3ee1aa576831c2ea9a9dfad RNReactNativeHapticFeedback: 00ba111b82aa266bb3ee1aa576831c2ea9a9dfad
RNReanimated: 66cf0f600a26d2b5e74c6e0b1c77c1ab1f62fc05 RNReanimated: 66cf0f600a26d2b5e74c6e0b1c77c1ab1f62fc05
RNScreens: ee069f569efb54804334321c916643f8cc9debaf RNScreens: b3975354ddafe0fb00112a9054898ccf0d92c78e
RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a RNShare: 6204e6a1987ba3e7c47071ef703e5449a0e3548a
RNSVG: a07e14363aa208062c6483bad24a438d5986d490 RNSVG: a07e14363aa208062c6483bad24a438d5986d490
RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28

5
package-lock.json generated
View file

@ -67,7 +67,7 @@
"react-native": "0.76.7", "react-native": "0.76.7",
"react-native-biometrics": "3.0.1", "react-native-biometrics": "3.0.1",
"react-native-blue-crypto": "github:BlueWallet/react-native-blue-crypto#3cb5442", "react-native-blue-crypto": "github:BlueWallet/react-native-blue-crypto#3cb5442",
"react-native-camera-kit": "14.2.0", "react-native-camera-kit": "https://github.com/BlueWallet/react-native-camera-kit.git#1e19212",
"react-native-crypto": "2.2.0", "react-native-crypto": "2.2.0",
"react-native-default-preference": "https://github.com/BlueWallet/react-native-default-preference.git#6338a1f1235e4130b8cfc2dd3b53015eeff2870c", "react-native-default-preference": "https://github.com/BlueWallet/react-native-default-preference.git#6338a1f1235e4130b8cfc2dd3b53015eeff2870c",
"react-native-device-info": "14.0.4", "react-native-device-info": "14.0.4",
@ -21732,8 +21732,7 @@
}, },
"node_modules/react-native-camera-kit": { "node_modules/react-native-camera-kit": {
"version": "14.2.0", "version": "14.2.0",
"resolved": "https://registry.npmjs.org/react-native-camera-kit/-/react-native-camera-kit-14.2.0.tgz", "resolved": "git+ssh://git@github.com/BlueWallet/react-native-camera-kit.git#1e1921223bc9da636f9889d96b03df5f77dc7bf1",
"integrity": "sha512-rPk/4Ux52/Kc6oIPk0x6NsrvDkeL+kd/GAUJ4xBtTlnmiWjLTgeA2Vjgg9ik03mmyf6rV+LaqaOBT7KejhuHKQ==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=18" "node": ">=18"

View file

@ -134,7 +134,7 @@
"react-native": "0.76.7", "react-native": "0.76.7",
"react-native-biometrics": "3.0.1", "react-native-biometrics": "3.0.1",
"react-native-blue-crypto": "github:BlueWallet/react-native-blue-crypto#3cb5442", "react-native-blue-crypto": "github:BlueWallet/react-native-blue-crypto#3cb5442",
"react-native-camera-kit": "14.2.0", "react-native-camera-kit": "https://github.com/BlueWallet/react-native-camera-kit.git#1e19212",
"react-native-crypto": "2.2.0", "react-native-crypto": "2.2.0",
"react-native-default-preference": "https://github.com/BlueWallet/react-native-default-preference.git#6338a1f1235e4130b8cfc2dd3b53015eeff2870c", "react-native-default-preference": "https://github.com/BlueWallet/react-native-default-preference.git#6338a1f1235e4130b8cfc2dd3b53015eeff2870c",
"react-native-device-info": "14.0.4", "react-native-device-info": "14.0.4",