![]() Light |
+ ![]() Dark |
+
![]() Before — single drawer menu |
+ ![]() After — revamped drawer |
+ ![]() After — new bottom tab bar |
+
![]() |
+ ![]() |
+ ![]() |
+
![]() |
+ ![]() |
+ ![]() |
+
Enter **admin** as the username and **1q2w3E** as the password to log in to the application.
The application is up and running. You can continue to develop your application based on this startup template.
+## Navigation
+
+The startup template ships with **two navigation styles**, switchable when the project is created:
+
+- **Bottom Tab** — *the default* — three tabs at the bottom of the screen: **Home**, **Settings** and **Account**.
+- **Drawer** — a side menu (hamburger) with two items: **Home** and **Settings**.
+
+
+
+
+Every main tab or drawer item is wired to **its own** native stack (`@react-navigation/native-stack`). Pushing more screens stays on that branch: the Back stack belongs to that tab or drawer route and does not mix with others. Bottom Tab and Drawer use the **same screen components**; they differ in how those screens are grouped and opened from the outer shell (and where the sign‑in/sign‑up flow lives in Bottom Tab versus Drawer).
+
+> **How to choose:** The mode is selected in **ABP Studio** during the *Mobile Framework* step. Switching modes after the project is generated is not a one-line change — you would need to add the missing navigator (and its `@react-navigation/drawer` or `@react-navigation/bottom-tabs` dependency) manually, then update `src/AppContainer.tsx` and `src/navigators/types.ts` to match. Pick the mode upfront when possible.
+
+### Bottom Tab Navigation (default)
+
+The root navigator is `BottomTabNavigator` (`src/navigators/BottomTabNavigator.tsx`) with three stacks:
+
+- **HomeTab** → `HomeNavigator` → `HomeScreen` (hero greeting + feature cards).
+- **SettingsTab** → `SettingsNavigator` → `SettingsScreen` (language, theme, profile/password shortcuts).
+- **AccountTab** → `AccountNavigator` — *conditional stack* based on the authentication state read from Redux:
+ - **Authenticated:** `AccountScreen` → `ChangePasswordScreen`, `ProfilePictureScreen`.
+ - **Guest:** `LoginScreen` → `RegisterScreen`, `ForgotPasswordScreen`, `ResetPasswordScreen`.
+
+Tab bar colors (active/inactive tint, background, border) are sourced from the `useThemeColors` hook so the bar follows the active light/dark theme.
+
+#### The Account Screen
+
+`AccountScreen` (`src/screens/Account/AccountScreen.tsx`) is the home of the AccountTab when the user is signed in. Its layout follows an iOS-style grouped pattern:
+
+1. **Profile header** — circular avatar (profile picture or first-letter fallback), full name and email, centered at the top.
+2. **Account actions card** — a single rounded card containing two rows with leading icon chips:
+ - **Profile Picture** → navigates to `ProfilePictureScreen`.
+ - **Change Password** → navigates to `ChangePasswordScreen`.
+3. **Destructive logout button** — an outlined `destructive`-colored button that calls the `useLogout` hook.
+
+### Drawer Navigation (alternative)
+
+When the drawer mode is selected, `DrawerNavigator` (`src/navigators/DrawerNavigator.tsx`) replaces the bottom tabs. It exposes two drawer items:
+
+- **HomeStack** → `HomeNavigator` → `HomeScreen`, plus the auth flow (`LoginScreen`, `RegisterScreen`, `ForgotPasswordScreen`, `ResetPasswordScreen`).
+- **SettingsStack** → `SettingsNavigator` → `SettingsScreen`, `ChangePasswordScreen`, `ProfilePictureScreen`.
+
+Note that there is **no `AccountTab` / `AccountScreen` in drawer mode** — auth lives in the Home stack and profile/password actions live in the Settings stack. The drawer side panel itself is fully custom.
+
+#### The Drawer Content
+
+`DrawerContent` (`src/components/DrawerContent/DrawerContent.tsx`) is the custom side panel rendered by `DrawerNavigator` via the `drawerContent` prop. From top to bottom:
+
+1. **User header** — circular avatar (image or first-letter fallback) + full name + email when authenticated.
+2. **Divider**.
+3. **Navigation items** — Home and Settings rows with leading Ionicons; tapping navigates and closes the drawer.
+4. **Auth row** — when authenticated, a **Logout** row that calls `useLogout`; when guest, a **Login** row that navigates to the Login screen inside `HomeStack`.
+
+The whole panel uses NativeWind classes with `dark:` variants, so it follows the active theme automatically.
+
+### Adding a New Screen
+
+To add a screen to either navigation mode:
+
+1. Create the screen component under `src/screens/
+
+---
+
+## 1. Project Files
+
+NativeWind is wired in through a small set of configuration files at the root of the React Native project:
+
+| File | Purpose |
+|------|---------|
+| `tailwind.config.js` | Defines the design tokens (colors, spacing, border radius), enables `darkMode: 'class'`, and registers the NativeWind preset. This is the source of truth for the theme. |
+| `global.css` | Tailwind entry point with the three base directives (`@tailwind base; @tailwind components; @tailwind utilities;`). |
+| `metro.config.js` | Wraps the default Expo Metro config with `withNativeWind(...)` and points it at `global.css`. |
+| `babel.config.js` | Adds the `nativewind/babel` preset and sets `jsxImportSource: 'nativewind'` on `babel-preset-expo` so JSX understands the `className` prop. |
+| `nativewind-env.d.ts` | TypeScript triple-slash reference (`///
+
+---
+
+## 4. The `useThemeColors` Hook
+
+A handful of APIs in the template do not accept a `className` — they need a *color value*. Examples:
+
+* `react-native-paper`'s `TextInput` (which the template still uses for outlined inputs and validation styling).
+* React Navigation's `screenOptions` (header background, tab bar tint, etc.).
+* The native status bar.
+
+For these cases the template ships a `useThemeColors` hook at `src/hooks/UseThemeColors.ts`. It returns theme-aware values that mirror the Tailwind tokens:
+
+```ts
+const {
+ primaryContainer, // Paper TextInput surface
+ headerBg, // Navigator headers
+ headerText,
+ iconColor, // Inactive icon tint
+ accentColor, // Active icon tint / focused tab
+ destructiveColor,
+ inputBorderColor,
+} = useThemeColors();
+```
+
+**Rule of thumb:** prefer `className` with `dark:` variants whenever the component supports it; reach for `useThemeColors` only for the components listed above.
+
+---
+
+## 5. React Native Paper
+
+`react-native-paper` is still in the template's `package.json`, but its usage has been narrowed down to a single component: **`TextInput`** in outlined mode (used for forms because of its strong validation/error UI). Buttons, lists, modals, drawers, and icons are all NativeWind + `@expo/vector-icons` (Ionicons) now.
+
+If you add new forms, follow the same split:
+
+* Use Paper's `TextInput` (with values from `useThemeColors`) for text fields.
+* Use plain `View`/`Text`/`Pressable` with NativeWind classes for everything else.
+
+---
+
+## 6. Customizing the Theme
+
+Most customization happens in `tailwind.config.js`. To introduce a brand color, extend the `colors` map and reuse the `{ DEFAULT, dark }` shape so the `dark:` variants keep working:
+
+```js
+// tailwind.config.js
+module.exports = {
+ // ...
+ theme: {
+ extend: {
+ colors: {
+ // ...
+ brand: {
+ DEFAULT: '#2563eb',
+ dark: '#3b82f6',
+ foreground: '#ffffff',
+ 'dark-foreground': '#ffffff',
+ },
+ },
+ },
+ },
+};
+```
+
+You can then use it from any component:
+
+```tsx
+