locaft_mobile/App.js

75 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-06-06 10:41:06 -07:00
import 'react-native-gesture-handler';
2021-06-02 11:29:39 -07:00
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
2021-06-06 10:41:06 -07:00
2021-06-02 11:29:39 -07:00
import {
2021-06-06 10:41:06 -07:00
SafeArea,
2021-06-02 11:29:39 -07:00
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import {
Colors,
DebugInstructions,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
2021-06-06 10:41:06 -07:00
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { enableScreens } from 'react-native-screens';
import HomeScreen from './components/HomeScreen'
2021-06-02 11:29:39 -07:00
const Section = ({children, title}): Node => {
const isDarkMode = useColorScheme() === 'dark';
return (
<View style={styles.sectionContainer}>
<Text
style={[
styles.sectionTitle,
{
color: isDarkMode ? Colors.white : Colors.black,
},
]}>
{title}
</Text>
<Text
style={[
styles.sectionDescription,
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}>
{children}
</Text>
</View>
);
};
2021-06-06 10:41:06 -07:00
const Stack = createStackNavigator();
const App = () => {
2021-06-02 11:29:39 -07:00
2021-06-06 10:41:06 -07:00
enableScreens();
2021-06-02 11:29:39 -07:00
return (
2021-06-06 10:41:06 -07:00
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
2021-06-03 09:34:29 -07:00
2021-06-02 11:29:39 -07:00
);
};
export default App;