first commit

This commit is contained in:
2026-01-07 10:35:00 +00:00
parent 13745ac89e
commit 3c7190bca4
53 changed files with 5538 additions and 531 deletions

View File

@@ -0,0 +1,59 @@
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { useApp } from '../context/AppContext';
import Landing from '../pages/Landing';
import AuthLogin from '../pages/AuthLogin';
import AuthRegister from '../pages/AuthRegister';
import Explore from '../pages/Explore';
import ShopDetails from '../pages/ShopDetails';
import Booking from '../pages/Booking';
import Cart from '../pages/Cart';
import Profile from '../pages/Profile';
import Dashboard from '../pages/Dashboard';
import { RootStackParamList } from './types';
const Stack = createNativeStackNavigator<RootStackParamList>();
export default function AppNavigator() {
const { user } = useApp();
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerStyle: { backgroundColor: '#f59e0b' },
headerTintColor: '#fff',
headerTitleStyle: { fontWeight: 'bold' },
}}
>
{!user ? (
<>
<Stack.Screen name="Landing" component={Landing} options={{ headerShown: false }} />
<Stack.Screen name="Login" component={AuthLogin} options={{ title: 'Entrar' }} />
<Stack.Screen name="Register" component={AuthRegister} options={{ title: 'Criar Conta' }} />
<Stack.Screen name="Explore" component={Explore} options={{ title: 'Explorar' }} />
<Stack.Screen name="ShopDetails" component={ShopDetails} options={{ title: 'Detalhes' }} />
<Stack.Screen name="Booking" component={Booking} options={{ title: 'Agendar' }} />
<Stack.Screen name="Cart" component={Cart} options={{ title: 'Carrinho' }} />
</>
) : user.role === 'barbearia' ? (
<>
<Stack.Screen name="Dashboard" component={Dashboard} options={{ title: 'Painel', headerShown: false }} />
<Stack.Screen name="Profile" component={Profile} options={{ title: 'Perfil' }} />
</>
) : (
<>
<Stack.Screen name="Explore" component={Explore} options={{ title: 'Explorar' }} />
<Stack.Screen name="ShopDetails" component={ShopDetails} options={{ title: 'Detalhes' }} />
<Stack.Screen name="Booking" component={Booking} options={{ title: 'Agendar' }} />
<Stack.Screen name="Cart" component={Cart} options={{ title: 'Carrinho' }} />
<Stack.Screen name="Profile" component={Profile} options={{ title: 'Perfil' }} />
</>
)}
</Stack.Navigator>
</NavigationContainer>
);
}

19
src/navigation/types.ts Normal file
View File

@@ -0,0 +1,19 @@
export type RootStackParamList = {
Landing: undefined;
Login: undefined;
Register: undefined;
Explore: undefined;
ShopDetails: { shopId: string };
Booking: { shopId: string };
Cart: undefined;
Profile: undefined;
Dashboard: undefined;
};
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}