implement prototipe of navigate

This commit is contained in:
gustavo-em 2022-02-16 14:10:13 -03:00
parent 701df1ff80
commit 80b544f270
4 changed files with 59 additions and 11 deletions

13
App.tsx
View File

@ -1,19 +1,16 @@
import 'react-native-gesture-handler';
import * as React from 'react';
import {StyleSheet, View, Platform, SafeAreaView} from 'react-native';
import {BigbluebuttonMobile} from 'bigbluebutton-mobile-sdk';
import { Bootstrap } from './react-native/bootstrap/start/component';
import { Routes } from './react-native/app/routes/component';
export default function App() {
return (
<SafeAreaView>
{/* <BigbluebuttonMobile
broadcastAppBundleId="org.bigbluebutton.mobile.BigBlueButton-Broadcast"
url="https://bigbluebutton.org"
style={styles.bbb}
/> */}
<Bootstrap/>
</SafeAreaView>
<>
<Routes/>
</>
);
}

View File

@ -0,0 +1,12 @@
import React from 'react'
import { Text, View } from 'react-native';
export const ListPortals = ()=>{
return (
<>
<View style={{marginTop: 10}}>
<Text style={{color: 'black'}}>List</Text>
</View>
</>
)
}

37
react-native/app/routes/component.js vendored Normal file
View File

@ -0,0 +1,37 @@
import * as React from 'react';
import { Button, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import { ListPortals } from '../pages/list_portals/component';
function NotificationsScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button onPress={() => navigation.goBack()} title="Go back home" />
</View>
);
}
function Test(){
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button title="Go back home" />
</View>
)
}
const Drawer = createDrawerNavigator();
export const Routes = ()=>{
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Portals" screenOptions={{ headerShown: false}}>
<Drawer.Screen name="Portals" component={ListPortals} />
<Drawer.Screen name="Notifications" component={NotificationsScreen} />
{['1','2'].map((item)=>{
return <Drawer.Screen key={item} name={item} component={NotificationsScreen} />
})}
</Drawer.Navigator>
</NavigationContainer>
);
}

View File

@ -1,14 +1,16 @@
import React from 'react'
import { Text, View } from 'react-native'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { Routes } from '../../app/routes/component';
//This archive is used to envolve app in contexts, libs, etc..
export const Bootstrap = ()=>{
return (
<>
<GestureHandlerRootView>
<View>
<Text>Bootstrap</Text>
</View>
<Text>a</Text>
<Routes/>
</GestureHandlerRootView>
</>
)