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 { useFonts, Roboto_400Regular, Roboto_700Bold } from '@expo-google-fonts/roboto';
|
||||||
import { GluestackUIProvider } from '@gluestack-ui/themed';
|
import { GluestackUIProvider } from '@gluestack-ui/themed';
|
||||||
|
|
||||||
import { Loading } from '@components/Loading';
|
|
||||||
|
|
||||||
import { config } from './config/gluestack-ui.config';
|
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() {
|
export default function App() {
|
||||||
const [fontsLoaded] = useFonts({
|
const [fontsLoaded] = useFonts({
|
||||||
|
|
@ -16,7 +16,7 @@ export default function App() {
|
||||||
return (
|
return (
|
||||||
<GluestackUIProvider config={config}>
|
<GluestackUIProvider config={config}>
|
||||||
{fontsLoaded ? (
|
{fontsLoaded ? (
|
||||||
<SignIn />
|
<Routes />
|
||||||
) : (
|
) : (
|
||||||
<Loading />
|
<Loading />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ const { Navigator, Screen } = createNativeStackNavigator<AuthRoutes>();
|
||||||
|
|
||||||
export function AuthRoutes() {
|
export function AuthRoutes() {
|
||||||
return (
|
return (
|
||||||
<Navigator>
|
<Navigator screenOptions={{ headerShown: false }}>
|
||||||
<Screen name="SignIn" component={SignIn} />
|
<Screen name="SignIn" component={SignIn} />
|
||||||
<Screen name="SignUp" component={SignUp} />
|
<Screen name="SignUp" component={SignUp} />
|
||||||
</Navigator>
|
</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