Skip to content

feat: implement file-based navigation with expo-router β€” replace hardcoded App.tsxΒ #57

Description

@Josue19-08

πŸ”– Title

Implement expo-router navigation β€” replace single hardcoded screen in `App.tsx`


πŸ“„ Description

Currently `App.tsx` renders exactly one screen unconditionally (`InvestScreen`). `expo-router` is already in `package.json` but the app entry point is still `node_modules/expo/AppEntry.js` β€” expo-router is never activated. `@react-navigation/native` is installed but neither `@react-navigation/native-stack` nor `@react-navigation/bottom-tabs` are installed, so there is no working navigator.

The result: `PayScreen`, `SignIn`, `CreateAccountScreen`, and any future screens are completely unreachable. The BottomBar tab switching does nothing β€” `activeTab` state in `MainLayout` is set but never used to change what's rendered.

This issue wires up expo-router properly with a bottom-tab layout and registers all existing screens as real navigable routes.


βœ… Tasks to complete

  • Update `package.json` `"main"` field from `"node_modules/expo/AppEntry.js"` to `"expo-router/entry"`
  • Create `app/_layout.tsx` β€” root layout wrapping the app in any global providers (safe area, etc.)
  • Create `app/(tabs)/_layout.tsx` β€” bottom tab navigator with tabs: Home (InvestScreen), Pay (PayScreen), Profile, Notifications. Use icons from `@expo/vector-icons` (already installed)
  • Create `app/(tabs)/index.tsx` β€” renders `InvestScreen`
  • Create `app/(tabs)/pay.tsx` β€” renders `PayScreen`
  • Create `app/(tabs)/profile.tsx` β€” placeholder (will be built in separate issue)
  • Create `app/(tabs)/notifications.tsx` β€” renders `NotificationsPanel` or a dedicated full-screen notifications view
  • Create `app/sign-in.tsx` and `app/create-account.tsx` β€” auth screens outside the tab group
  • Remove `App.tsx` (or reduce it to nothing β€” expo-router takes over)
  • Remove `activeTab` state and conditional tab logic from `MainLayout.tsx` β€” navigation is now handled by expo-router
  • Update `BottomBar.tsx` β€” replace custom tab switching with `useRouter` from expo-router or remove it entirely (expo-router provides its own tab bar via `Tabs` component)
  • Install missing package: `expo install expo-router` (ensure version matches Expo SDK)

πŸ“š Documentation/context for AI

https://github.com/TrustUp-app/TrustUp-Frontend/tree/main/docs

Files to create:

  • `app/_layout.tsx`
  • `app/(tabs)/_layout.tsx`
  • `app/(tabs)/index.tsx`
  • `app/(tabs)/pay.tsx`
  • `app/(tabs)/profile.tsx`
  • `app/(tabs)/notifications.tsx`
  • `app/sign-in.tsx`
  • `app/create-account.tsx`

Files to modify:

  • `package.json` (main entry)
  • `components/shared/MainLayout.tsx` (remove tab state)
  • `components/shared/BottomBar.tsx` (integrate with router or remove)

πŸ—’οΈ Additional notes

  • The tab bar should have 4 tabs: Home (house icon), Pay (credit-card icon), Notifications (bell icon), Profile (person icon)
  • Auth screens (`sign-in`, `create-account`) live outside the `(tabs)` group β€” they should not show the tab bar
  • Use `expo-router`'s `` component for the tab navigator β€” do not install `@react-navigation/bottom-tabs` separately
  • The `NotificationsPanel` slide-in panel behavior should be replaced by a proper full-screen route at `/notifications`
  • Keep `MainLayout.tsx` for the header only β€” remove the ScrollView wrapper and tab state from it

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions