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 CameraScreen from "./src/screens/Camera";
import Main from "./src/screens/Main";
import { StatusBar } from "expo-status-bar";
const Stack = createNativeStackNavigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator
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.Navigator>
</NavigationContainer>
<>
<StatusBar style="light" />
<NavigationContainer>
<Stack.Navigator
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.Navigator>
</NavigationContainer>
</>
);
}

@ -15,6 +15,7 @@
"expo-barcode-scanner": "~12.9.3",
"expo-camera": "~14.0.5",
"expo-haptics": "~12.8.1",
"expo-permissions": "^14.4.0",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.4",
@ -7865,6 +7866,14 @@
"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": {
"version": "1.11.1",
"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-barcode-scanner": "~12.9.3",
"expo-camera": "~14.0.5",
"expo-haptics": "~12.8.1",
"expo-permissions": "^14.4.0",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.4",
@ -24,8 +26,7 @@
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"text-encoding": "^0.7.0",
"zustand": "^4.5.2",
"expo-haptics": "~12.8.1"
"zustand": "^4.5.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",

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

Loading…
Cancel
Save