Skip to content

Use Expo Router#399

Open
manuthecoder wants to merge 68 commits intomainfrom
use-expo-router
Open

Use Expo Router#399
manuthecoder wants to merge 68 commits intomainfrom
use-expo-router

Conversation

@manuthecoder
Copy link

Rewrites HCB Mobile from React Native navigation → Expo Router for better code quality

Copilot AI review requested due to automatic review settings February 15, 2026 08:29
@manuthecoder manuthecoder requested a review from a team as a code owner February 15, 2026 08:29
@manuthecoder manuthecoder marked this pull request as draft February 15, 2026 08:30

This comment was marked as spam.

Move App.tsx to app/_layout.tsx and rename the component to Layout
Replace NavigationContainer with expo-router Stack and update imports
Move login page into app/ routing and adjust tsconfig include paths
Add a minimal test page and fix asset/import path references
Introduce events index and event detail pages with transactions UI
and Tap-to-Pay / mock transaction support. Add events Stack layout.

Refactor app layout: move AppContent into expo-router layout, add
cards/receipts/settings routes, share-intent handling, and reorderable
organizations list.

Add TS path aliases and SWRCacheProvider context.
Add app/(app)/(events)/[id]/transactions.tsx to host the transactions
list and related logic. Introduce ListItemButton and ListItemText
helpers in index.tsx, update imports (router, Ionicons, Pressable, Text,
ScrollView), and register the new route in _layout.tsx. Remove unused
tab bar/footer code and adjust navigation/data fetching usage.
Set the default fontSize to 16 in components/Text and remove the
explicit fontSize from ListItemText so it uses the new default.

Add a TabBarStyling component to the events layout that uses
usePathname/useNavigation to hide the tab bar when the events stack
is not at its root path.
Move full Cards and Receipts implementations into app/(app) routes
and remove the legacy src/pages versions. Add a reusable PageTitle
component and use it in Cards (and import into Events). Update
Navigator imports to point to the new Cards page location.
Add PageTitle as the ListHeaderComponent for Receipts and increase
contentContainerStyle paddingTop to 62 to prevent header overlap
Implement a detailed transaction viewer (sharing, comments, admin tools,
type-specific renderers). Use NavigationProp for TransactionViewProps to
align with expo-router and remove unused imports in receipts
@manuthecoder manuthecoder marked this pull request as ready for review March 1, 2026 21:12
manuthecoder pushed a commit that referenced this pull request Mar 1, 2026
Bugs fixed:

app/(app)/_layout.tsx:
- Remove debug console.log leaking invitation data in production
- Remove dead `linking` useMemo (was never connected to the tree); replace
  with a useEffect that restores the URL-interception behaviors: blocked paths
  (/branding, /security, etc.) redirect to hcb.hackclub.com, and URLs are
  opened in the browser when universal linking is disabled
- Remove legacy StackParamList / TabParamList / NavigationContainerRef /
  LinkingOptions imports that belonged to the old React Navigation setup
- Remove unused navigationRef (NavigationContainerRef passed to Tabs)

app/(app)/(events)/[id]/index.tsx:
- Fix 401 retry: organizationErrorStatus was a boolean, so its .toString()
  was "true"/"false" — never contained "401". Now checks organizationError
  directly
- Remove duplicate organizationErrorStatus (identical to isAccessDenied)
- Remove second useEffect that unconditionally overwrote the "Access Denied"
  / "Offline" title set by the first effect
- Change bare console.log(e) catch to a silent catch with a comment — the
  throw from beforePress is intentional flow control, not an error

app/(app)/(events)/[id]/transactions/index.tsx:
- Same broken 401 check fix as above
- Remove duplicate organizationErrorStatus variable

app/(app)/(events)/invitation/[id].tsx:
- Wrap JSON.parse(_invitation) in try/catch to prevent crash on malformed
  or missing deep-link params
- Remove useEffect watching invitation.accepted that caused a double-
  navigation race condition with onSuccess
- Fix wrong relative pathname "[id]" → absolute "/(events)/[id]"
- Use router.replace() in onSuccess for atomic back+navigate (avoids
  stacking an extra screen)
- Remove now-unused useEffect, useNavigation, navigation imports

app/(app)/receipts/index.tsx:
- Fix pathname "[id]/transactions/[transactionId]" → absolute
  "/(events)/[id]/transactions/[transactionId]"
- Wrap onRefresh in useCallback so useFocusEffect dependency array is not
  stale (was [], missing onRefresh)

app/(app)/(events)/[id]/donations/index.tsx:
- Fix router.replace pathname `/[id]/donations/new` (literal segment, not
  dynamic) → "/(events)/[id]/donations/new"; pass id in params
- Rename locationIdStripeMock → stripeTerminalLocationId with a TODO comment

app/_layout.tsx / app/login/index.tsx:
- Migrate all ../src/ relative imports to @/ path aliases for consistency

https://claude.ai/code/session_01ErZNivaNSVwzAHpADmT4wX
Co-authored-by: Claude <noreply@anthropic.com>
…use'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Enable/adjust various ESLint rules and remove many eslint-disable
comments across the app. Replace ts-ignores with safer casts (FormData
file -> unknown as Blob), include src in lint scripts, fix hook
dependency arrays, and tighten some typings (navigation, watch
connectivity imports)
manuthecoder and others added 4 commits March 2, 2026 19:08
Use router.push/router.navigate instead of passing navigation props
across events, GrantInvite, TransferTransaction and utilities, passing
route params as JSON where needed.

Add handleMenuActionEvent to centralize organization menu routing and
donation device support checks.

Safely parse organization param on the transfer page and showAlert with
router.back if parsing fails.
Deprecate custom getStateFromPath and remove references to
NavigatorParamList/NativeStackNavigationProp. Stop requiring
navigation props in transaction view components, adjust router
params to include ids and JSON strings, and add missing stack
screens and small UI/import cleanups.
Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI added a commit that referenced this pull request Mar 5, 2026
Co-authored-by: manuthecoder <77016441+manuthecoder@users.noreply.github.com>
Copilot AI and others added 2 commits March 4, 2026 18:17
)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: manuthecoder <77016441+manuthecoder@users.noreply.github.com>
TransactionPage: simplify transactionViewProps to { orgId } (remove
currentOrgId and navigation)

Cards page: add setRefreshing setter and call setRefreshing(true) at
start of onRefresh and setRefreshing(false) in finally to correctly
manage refreshing state
Copilot AI mentioned this pull request Mar 5, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants