-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
40 lines (36 loc) · 1.32 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createDrawerNavigator } from "@react-navigation/drawer";
import TableList from "./components/TableList/TableList";
import ModalComponent from "./components/ModalComponent";
import { ModalProvider } from "./context/ModalContext";
import CRUDform from "./components/CRUDform";
import { ToastProvider } from "react-native-toast-notifications";
import TableListScreen from "./screens/TableListScreen";
import HomeScreen from "./screens/HomeScreen";
const TableListUsageExample = () => {
return <TableList table_name="user" dbFields={["id", "name", "email"]} />;
};
const screens = [
{ name: "Home", screen: HomeScreen },
{ name: "Admin TableList", screen: TableListScreen },
{ name: "List Users (not admin example)", screen: TableListUsageExample },
];
const Drawer = createDrawerNavigator();
const App = () => {
return (
<ModalProvider>
<ToastProvider>
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
{screens.map(({ name, screen }) => (
<Drawer.Screen key={name} name={name} component={screen} />
))}
</Drawer.Navigator>
</NavigationContainer>
<ModalComponent />
</ToastProvider>
</ModalProvider>
);
};
export default App;