Panahashi’s navigation is built with React Navigation and composed of two layers: a native stack (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi/llms.txt
Use this file to discover all available pages before exploring further.
RootNavigator) that controls which screens are available based on authentication state, and a bottom tab navigator (MainTabs) that forms the core of the authenticated experience. Both layers are mounted inside a NavigationContainer at the root of App.js, with AuthProvider and CartProvider wrapping the entire tree.
Navigation layers
RootNavigator is a native stack that reads user and loading from useAuth(). Depending on auth state, it conditionally renders different sets of screens:
| State | Accessible screens |
|---|---|
Authenticated (user is set) | Main (bottom tabs) + all detail/flow screens |
Unauthenticated (user is null) | Login only |
BakeryDetail, Payment, etc.) sit in the stack above Main so they can overlay the tab bar when pushed — standard React Navigation layering for modal-style flows.
Bottom tab bar
MainTabs renders five tabs. All headers are hidden (headerShown: false) so each screen owns its own header if needed.
| Tab name | Label | Route |
|---|---|---|
| Home | Inicio | HomeScreen |
| Bakeries | Panaderías | BakeriesScreen |
| Cart | Carrito | CartScreen |
| Orders | Pedidos | OrdersScreen |
| Profile | Perfil | ProfileScreen |
screenOptions:
- Active tint:
#F97316(Panahashi orange) - Inactive tint:
#aaa - Height:
65px, withpaddingBottom: 10andpaddingTop: 6
Cart badge
The Cart tab uses a customCartBadge component instead of a plain icon. It reads itemCount from useCart() and renders a count bubble when the cart is non-empty:
top: -4, right: -6). It uses CartContext’s itemCount, which is the sum of all item quantities in the current cart.
CartBadge relies on CartProvider being mounted above NavigationContainer in the tree. The provider order in App.js — AuthProvider → CartProvider → NavigationContainer — ensures this is always satisfied.Auth guard
RootNavigator implements the auth guard pattern directly in JSX using a conditional block:
loading is true (before Firebase’s onAuthStateChanged fires for the first time), a centered ActivityIndicator is shown. This prevents a flash of the Login screen before the persisted session is restored. Once loading resolves, the stack renders either the authenticated screens or the Login screen — there is no manual redirect needed.