Skip to content

Commit

Permalink
Install expo router and route to the qr scanner screen
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Oct 5, 2024
1 parent 48baa8c commit 88417f4
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 24 deletions.
50 changes: 36 additions & 14 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
import { StyleSheet, View } from 'react-native';
import { StatusBar } from 'expo-status-bar';
// In App.js in a new project

import * as React from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import QRCodeScanner from '@/components/QRCodeScanner/QRCodeScanner';

export default function StartPage() {
function HomeScreen() {
return (
<View style={styles.container}>
<QRCodeScanner />
<StatusBar style="auto" />
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
const Stack = createNativeStackNavigator();

function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Scanner">
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Scanner"
component={QRCodeScanner}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Tree"
component={HomeScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}

export default App;
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"react-native-toast-message": "^2.2.1",
"react-native-url-polyfill": "^2.0.0",
"zod": "^3.23.8",
"zustand": "^5.0.0-rc.2"
"zustand": "^5.0.0-rc.2",
"react-native-screens": "3.31.1",
"react-native-safe-area-context": "4.10.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
Empty file added src/app/index.tsx
Empty file.

0 comments on commit 88417f4

Please sign in to comment.