-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install expo router and route to the qr scanner screen
- Loading branch information
1 parent
48baa8c
commit 88417f4
Showing
4 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.