locaft_mobile/App.js

107 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-06-06 10:41:06 -07:00
import 'react-native-gesture-handler';
2022-05-08 05:19:40 -07:00
import React, {useEffect} from 'react';
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';
2022-05-08 05:19:40 -07:00
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {enableScreens} from 'react-native-screens';
2022-05-25 21:15:54 -07:00
import RNBootSplash from 'react-native-bootsplash';
2022-05-08 05:19:40 -07:00
import HomeScreen from './components/HomeScreen';
import BottomTab from './components/BottomTab';
import RegisterUserScreen from './components/RegisterUserScreen';
import LoginUserScreen from './components/LoginUserScreen.js';
2022-05-25 21:15:54 -07:00
import SearchHouse from './components/SearchHouse.js';
2022-05-28 07:55:11 -07:00
import HouseProfile from './components/HouseProfile.js';
2022-05-30 12:57:06 -07:00
import UserProfile from './components/UserProfile.js';
2022-05-08 05:19:40 -07:00
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();
2022-05-08 05:19:40 -07:00
const App = () => {
enableScreens();
2022-05-25 21:15:54 -07:00
useEffect(() => {}, []);
2021-06-02 11:29:39 -07:00
return (
2022-05-08 05:19:40 -07:00
<NavigationContainer onReady={() => RNBootSplash.hide()}>
<Stack.Navigator initialRouteName="BottomTab">
<Stack.Screen
name="BottomTab"
component={BottomTab}
options={{headerShown: false}}
/>
<Stack.Screen
name="Test"
component={HomeScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="LoginUserScreen"
component={LoginUserScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="RegisterUserScreen"
component={RegisterUserScreen}
options={{headerShown: false}}
/>
2022-05-25 21:15:54 -07:00
<Stack.Screen
name="SearchHouse"
component={SearchHouse}
options={{headerShown: false}}
/>
2022-05-28 07:55:11 -07:00
<Stack.Screen
name="HouseProfile"
component={HouseProfile}
options={{headerShown: false}}
/>
2022-05-30 12:57:06 -07:00
<Stack.Screen
name="UserProfile"
component={UserProfile}
options={{headerShown: false}}
/>
2022-05-08 05:19:40 -07:00
</Stack.Navigator>
2021-06-06 10:41:06 -07:00
</NavigationContainer>
2021-06-02 11:29:39 -07:00
);
};
export default App;