Fakultas Ilmu Komputer UI

index.tsx 964 Bytes
Newer Older
1
import 'react-native-gesture-handler';
2
3
4
import React, { FC } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
5
6
import { ThemeProvider } from 'react-native-elements';
import { SafeAreaProvider } from 'react-native-safe-area-context';
7
8
9

import * as ROUTES from 'constants/routes';
import { navigation } from 'constants/navigation';
10
import { theme } from 'styles/theme';
11
12
13
14
15

const Stack = createStackNavigator();

const App: FC = () => {
  return (
16
17
18
19
20
21
22
23
24
25
26
    <SafeAreaProvider>
      <ThemeProvider theme={theme}>
        <NavigationContainer>
          <Stack.Navigator initialRouteName={ROUTES.home}>
            {navigation.map(({ name, component }, i) => (
              <Stack.Screen name={name} component={component} key={i} />
            ))}
          </Stack.Navigator>
        </NavigationContainer>
      </ThemeProvider>
    </SafeAreaProvider>
27
28
29
30
  );
};

export default App;