More changes

pull/256/head
Ty Fiero 9 months ago
parent 34207314f5
commit 2e0ab15e5b

@ -4,23 +4,27 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeScreen from "./src/screens/HomeScreen"; import HomeScreen from "./src/screens/HomeScreen";
import CameraScreen from "./src/screens/Camera"; import CameraScreen from "./src/screens/Camera";
import Main from "./src/screens/Main"; import Main from "./src/screens/Main";
import { StatusBar } from "expo-status-bar";
const Stack = createNativeStackNavigator(); const Stack = createNativeStackNavigator();
function App() { function App() {
return ( return (
<NavigationContainer> <>
<Stack.Navigator <StatusBar style="light" />
initialRouteName="Home" <NavigationContainer>
screenOptions={{ <Stack.Navigator
headerShown: false, // This hides the navigation bar globally initialRouteName="Home"
}} screenOptions={{
> headerShown: false, // This hides the navigation bar globally
<Stack.Screen name="Home" component={HomeScreen} /> }}
<Stack.Screen name="Camera" component={CameraScreen} /> >
<Stack.Screen name="Main" component={Main} /> <Stack.Screen name="Home" component={HomeScreen} />
</Stack.Navigator> <Stack.Screen name="Camera" component={CameraScreen} />
</NavigationContainer> <Stack.Screen name="Main" component={Main} />
</Stack.Navigator>
</NavigationContainer>
</>
); );
} }

@ -15,6 +15,7 @@
"expo-barcode-scanner": "~12.9.3", "expo-barcode-scanner": "~12.9.3",
"expo-camera": "~14.0.5", "expo-camera": "~14.0.5",
"expo-haptics": "~12.8.1", "expo-haptics": "~12.8.1",
"expo-permissions": "^14.4.0",
"expo-status-bar": "~1.11.1", "expo-status-bar": "~1.11.1",
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.73.4", "react-native": "0.73.4",
@ -7865,6 +7866,14 @@
"invariant": "^2.2.4" "invariant": "^2.2.4"
} }
}, },
"node_modules/expo-permissions": {
"version": "14.4.0",
"resolved": "https://registry.npmjs.org/expo-permissions/-/expo-permissions-14.4.0.tgz",
"integrity": "sha512-oAcnJ7dlZhpBydK73cwomA2xofizayVUz+FW5REl7dMu7MYyeN/3aqhlpZ3mYddrxvG161bqu97MQr01UixUnw==",
"peerDependencies": {
"expo": "*"
}
},
"node_modules/expo-status-bar": { "node_modules/expo-status-bar": {
"version": "1.11.1", "version": "1.11.1",
"resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.11.1.tgz", "resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.11.1.tgz",

@ -16,6 +16,8 @@
"expo-av": "~13.10.5", "expo-av": "~13.10.5",
"expo-barcode-scanner": "~12.9.3", "expo-barcode-scanner": "~12.9.3",
"expo-camera": "~14.0.5", "expo-camera": "~14.0.5",
"expo-haptics": "~12.8.1",
"expo-permissions": "^14.4.0",
"expo-status-bar": "~1.11.1", "expo-status-bar": "~1.11.1",
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.73.4", "react-native": "0.73.4",
@ -24,8 +26,7 @@
"react-native-safe-area-context": "4.8.2", "react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0", "react-native-screens": "~3.29.0",
"text-encoding": "^0.7.0", "text-encoding": "^0.7.0",
"zustand": "^4.5.2", "zustand": "^4.5.2"
"expo-haptics": "~12.8.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.0", "@babel/core": "^7.20.0",

@ -4,11 +4,11 @@ import * as FileSystem from "expo-file-system";
import { AVPlaybackStatus, AVPlaybackStatusSuccess, Audio } from "expo-av"; import { AVPlaybackStatus, AVPlaybackStatusSuccess, Audio } from "expo-av";
import { polyfill as polyfillEncoding } from "react-native-polyfill-globals/src/encoding"; import { polyfill as polyfillEncoding } from "react-native-polyfill-globals/src/encoding";
import { create } from "zustand"; import { create } from "zustand";
import useStore from "../lib/state"; import useStore from "../utils/state";
import { Animated } from "react-native"; import { Animated } from "react-native";
import * as Haptics from "expo-haptics"; import * as Haptics from "expo-haptics";
import useSoundEffect from "../lib/useSoundEffect"; import useSoundEffect from "../utils/useSoundEffect";
import IconImage from "../../assets/qr.png"; // import IconImage from "../../assets/qr.png";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
interface MainProps { interface MainProps {
@ -132,7 +132,7 @@ const Main: React.FC<MainProps> = ({ route }) => {
}, [audioQueue, sound, soundUriMap]); }, [audioQueue, sound, soundUriMap]);
const _onPlayBackStatusUpdate = useCallback( const _onPlayBackStatusUpdate = useCallback(
async (status) => { async (status: any) => {
if (status.didJustFinish) { if (status.didJustFinish) {
await sound?.unloadAsync(); await sound?.unloadAsync();
soundUriMap.delete(sound); soundUriMap.delete(sound);
@ -232,6 +232,14 @@ const Main: React.FC<MainProps> = ({ route }) => {
}; };
}, [scannedData]); }, [scannedData]);
useEffect(() => {
console.log("Permission Response:", permissionResponse);
if (permissionResponse?.status !== "granted") {
console.log("Requesting permission..");
requestPermission();
}
}, []);
const startRecording = useCallback(async () => { const startRecording = useCallback(async () => {
if (recording) { if (recording) {
console.log("A recording is already in progress."); console.log("A recording is already in progress.");
@ -239,6 +247,10 @@ const Main: React.FC<MainProps> = ({ route }) => {
} }
try { try {
console.log("🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️");
console.log(permissionResponse);
if ( if (
permissionResponse !== null && permissionResponse !== null &&
permissionResponse.status !== `granted` permissionResponse.status !== `granted`

Loading…
Cancel
Save