feat: add route navigation
This commit is contained in:
parent
1603a452af
commit
0a9fd46fa7
3 changed files with 17 additions and 5 deletions
8
App.tsx
8
App.tsx
|
|
@ -2,10 +2,10 @@ import { StatusBar } from 'react-native';
|
|||
import { useFonts, Roboto_400Regular, Roboto_700Bold } from '@expo-google-fonts/roboto';
|
||||
import { GluestackUIProvider } from '@gluestack-ui/themed';
|
||||
|
||||
import { Loading } from '@components/Loading';
|
||||
|
||||
import { config } from './config/gluestack-ui.config';
|
||||
import { SignIn } from '@screens/SignIn';
|
||||
|
||||
import { Loading } from '@components/Loading';
|
||||
import { Routes } from '@routes/index';
|
||||
|
||||
export default function App() {
|
||||
const [fontsLoaded] = useFonts({
|
||||
|
|
@ -16,7 +16,7 @@ export default function App() {
|
|||
return (
|
||||
<GluestackUIProvider config={config}>
|
||||
{fontsLoaded ? (
|
||||
<SignIn />
|
||||
<Routes />
|
||||
) : (
|
||||
<Loading />
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const { Navigator, Screen } = createNativeStackNavigator<AuthRoutes>();
|
|||
|
||||
export function AuthRoutes() {
|
||||
return (
|
||||
<Navigator>
|
||||
<Navigator screenOptions={{ headerShown: false }}>
|
||||
<Screen name="SignIn" component={SignIn} />
|
||||
<Screen name="SignUp" component={SignUp} />
|
||||
</Navigator>
|
||||
|
|
|
|||
12
src/routes/index.tsx
Normal file
12
src/routes/index.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { NavigationContainer } from "@react-navigation/native";
|
||||
|
||||
import { AuthRoutes } from "./auth.routes";
|
||||
|
||||
export function Routes() {
|
||||
return (
|
||||
<NavigationContainer>
|
||||
<AuthRoutes />
|
||||
</NavigationContainer>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue