Repository navigation
Redirection changes - #61
Conversation
WalkthroughThe pull request introduces changes to the authentication and navigation flow in a React Native application. A new "pre-signin" screen has been added to the authentication layout, and the root layout navigation logic has been modified to handle session-based routing more dynamically. The changes remove previous onboarding group checks and implement a more direct navigation approach across both web and non-web platforms. Additionally, the Changes
Possibly related PRs
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/_layout.tsx (1)
120-133: Navigation logic looks good, consider adding error boundariesThe simplified navigation logic is clear and handles the session states appropriately. However, consider adding error handling for edge cases where navigation might fail.
if ( session && (inAuthGroup || pathname === "/") ) { // On boot up, session exist and user is in auth group or /, redirect to collaborations - resetAndNavigate("/explore-influencers"); + try { + resetAndNavigate("/explore-influencers"); + } catch (error) { + console.error("Navigation failed:", error); + // Implement fallback navigation or error reporting + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/(main)/(screens)/(onboarding)/onboarding-your-brand.tsx(1 hunks)app/_layout.tsx(3 hunks)components/drawer-layout/DrawerMenuContent.tsx(1 hunks)contexts/auth-context.provider.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- contexts/auth-context.provider.tsx
🔇 Additional comments (4)
app/_layout.tsx (2)
145-146: Stack screen configuration is consistentThe screen configuration aligns well with the navigation changes. The headerShown option is consistently applied.
✅ Verification successful
Stack screen configuration verified successfully
Both
(main)and(auth)screen groups have their corresponding layout files properly implemented in the expected locations.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the existence of corresponding layout files for (main) and (auth) groups echo "Checking for layout files:" fd -e tsx -e ts "(_layout|index)\.(tsx|ts)" app/\(main\) fd -e tsx -e ts "(_layout|index)\.(tsx|ts)" app/\(auth\)Length of output: 330
40-40: Verify the implementation of resetAndNavigate utilityThe new utility function appears to handle both navigation reset and redirection. Let's verify its implementation to ensure it properly handles navigation state.
✅ Verification successful
Verified: resetAndNavigate utility is properly implemented and used
The utility function in
utils/router.tscorrectly handles navigation state by clearing the stack when possible and replacing the current route. Its usage in the authentication flow follows best practices for route management.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for the implementation and usage of resetAndNavigate echo "Searching for resetAndNavigate implementation:" rg -l "resetAndNavigate" --type ts echo "\nSearching for resetAndNavigate definition:" ast-grep --pattern 'export function resetAndNavigate($_) { $$$ }'Length of output: 373
Script:
#!/bin/bash # Get the implementation and surrounding context echo "Content of utils/router.ts:" cat utils/router.ts echo -e "\nUsage in auth context:" rg -A 5 -B 5 "resetAndNavigate" contexts/auth-context.provider.tsxLength of output: 1569
app/(main)/(screens)/(onboarding)/onboarding-your-brand.tsx (1)
94-94: Verify navigation flow after pathname simplificationThe pathname has been simplified from
"/(onboarding)/onboarding-get-started"to"/onboarding-get-started". While this aligns with the PR's goal of simplifying routes, we should ensure the new path is properly configured in the router.✅ Verification successful
Navigation path simplification is correctly implemented
The simplified pathname
/onboarding-get-startedaligns with the Next.js app router structure and the file exists at the correct location. No references to the old path format were found, confirming a clean transition.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new route path exists and there are no references to the old path # Check for route configuration fd -e tsx -e ts "onboarding-get-started" app/ # Check for any remaining references to the old path format rg "\(/\(onboarding\)/onboarding-get-started\)"Length of output: 156
Script:
#!/bin/bash # Search for all references to the route rg "onboarding-get-started" -A 2 -B 2 # Look for navigation patterns (push, replace, href) rg "(href|push|replace).*onboarding-get-started"Length of output: 534
components/drawer-layout/DrawerMenuContent.tsx (1)
245-245: Verify drawer navigation with simplified pathnameThe pathname has been simplified from
"/(onboarding)/onboarding-your-brand"to"/onboarding-your-brand". This change is consistent with the PR's routing simplification, but we should verify the drawer navigation still works correctly.✅ Verification successful
Pathname change is correct and consistent with routing system
The simplified pathname
/onboarding-your-brandmatches the expected URL structure in Expo Router, where route groups (folders in parentheses) don't affect the final URL path. The drawer navigation will work correctly with this change.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new route path exists and there are no references to the old path # Check for route configuration fd -e tsx -e ts "onboarding-your-brand" app/ # Check for any remaining references to the old path format rg "\(/\(onboarding\)/onboarding-your-brand\)" # Check if there are any other drawer menu items still using the old format rg "\(/\([^)]+\)/" components/drawer-layout/Length of output: 200
Script:
#!/bin/bash # Check the content of the page file cat "app/(main)/(screens)/(onboarding)/onboarding-your-brand.tsx" # Look for route configuration files fd "route|page" app/ # Search for route mapping patterns or configuration rg -g "!*.{json,md}" "export const runtime|export const dynamic|rewrite|redirect" app/Length of output: 4018
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes * pushed new icons * pushed brand modal fixes * pushed changes * Icons changes (#73) * icons changes * icons changes * email verification * changed icon * pushed slight change to dev for a slight route change * merge conflict * refactor code (#75) --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes * pushed new icons * pushed brand modal fixes * pushed changes * Icons changes (#73) * icons changes * icons changes * email verification * changed icon * pushed slight change to dev for a slight route change * merge conflict * refactor code (#75) * feedbacks resolved (#77) * pushed changes * Feedbacks resolved (#79) * feedbacks resolved * max width refactor * removed unused imports * reusable component fix --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
Summary by CodeRabbit
New Features
Refactor
Improvements