forked from flemingvincent/expo-supabase-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Task Description
Replace the hardcoded email "[email protected]" in the settings screen with the dynamic email address from the authenticated Supabase user. Update the avatar to display the first letter of the user's email address. Add a FlatList section containing a single deep link item that navigates users to iOS Settings for subscription management.
Existing Context
settings.tsxcurrently displays static user profile with hardcoded email "[email protected]" and avatar text "Z"useSupabase()hook already provides access to authenticated user data viauserandsessionobjectsSupabaseProvidermanages authentication state with initialization tracking- Pro badge component is already implemented and should remain static
- Existing UI components (Avatar, Badge, Button, Text) are available for reuse
Acceptance Criteria
- Settings screen displays the authenticated user's actual email address instead of "[email protected]"
- Avatar shows the first letter of the user's email address (e.g., "j" for "[email protected]")
- Pro badge remains static as "Pro"
- FlatList contains exactly one item: "Manage Subscription" with deep link to iOS Settings
- Graceful handling when user email is not available (fallback display)
- No loading state required - use existing SupabaseProvider initialization
Scope and Constraints
- Modify only
app/(app)/(protected)/settings.tsx - Use existing
useSupabase()hook - no new context or state management - Leverage existing UI components from
/components/ui/ - Follow KISS principle - minimal code changes
- Maintain all existing functionality (signOut, styling, layout)
- iOS-specific deep link implementation only
Dependencies
context/supabase-provider.tsx- provides user authentication datacomponents/ui/avatar.tsx- for user avatar displaycomponents/ui/badge.tsx- for Pro badge (unchanged)components/ui/button.tsx- for Sign Out button (unchanged)components/ui/text.tsx- for text display- React Native
LinkingAPI for iOS Settings deep link
Resources and References
- Supabase User object documentation
- React Native Linking API for iOS Settings deep link
- iOS Settings URL schemes
- Existing
SupabaseProviderimplementation for user data access patterns
Deliverables
- Modified
app/(app)/(protected)/settings.tsxwith dynamic email display - Updated Avatar component to show first letter of user email
- Added FlatList with iOS Settings deep link for subscription management
- Proper error handling for missing user email data
Risks or Challenges
- User email might be null/undefined during authentication state transitions
- iOS Settings deep link behavior varies across iOS versions
- Avatar logic needs proper email validation and fallback handling
- FlatList integration should maintain consistent styling with existing layout
Metadata
Metadata
Assignees
Labels
No labels