-
Notifications
You must be signed in to change notification settings - Fork 1
feat(profile): complete profile page and related pages #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
bffba31
4850f63
531d7e6
83c7957
ad4efcd
f626f99
0e5f91c
ca92fd3
949f7b9
90e9b79
6d5f4d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| { | ||
| "java.compile.nullAnalysis.mode": "automatic" | ||
| "java.compile.nullAnalysis.mode": "automatic", | ||
| "cSpell.words": [ | ||
| "Verticborder" | ||
| ] | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| packages: | ||
| - 'src/*' | ||
| onlyBuiltDependencies: | ||
| - '@clerk/shared' | ||
| - browser-tabs-lock | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import React from "react" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { ThemeProvider } from "~/contexts/ThemeContext" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { ProfileScreen } from "~/components/profile/ProfileScreen" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { LimitsScreen } from "~/components/profile/Limits" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { IncomeScreen } from "~/components/profile/Income" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { NotificationScreen } from "~/components/profile/Notification" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { UserProfileScreen } from "~/components/profile/UserProfile" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { BankAccountsScreen } from "~/components/profile/BankAccounts" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const ProfileAppContent: React.FC = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [currentScreen, setCurrentScreen] = React.useState("Profile") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const handleNavigate = (screen: string) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setCurrentScreen(screen) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const renderScreen = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| switch (currentScreen) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "Profile": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <ProfileScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "Limits": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <LimitsScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "Income": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <IncomeScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "Notification": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <NotificationScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "UserProfile": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <UserProfileScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "BankAccounts": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <BankAccountsScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <ProfileScreen onNavigate={handleNavigate} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return renderScreen() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const ProfileAppContent: React.FC = () => { | |
| const [currentScreen, setCurrentScreen] = React.useState("Profile") | |
| const handleNavigate = (screen: string) => { | |
| setCurrentScreen(screen) | |
| } | |
| const renderScreen = () => { | |
| switch (currentScreen) { | |
| case "Profile": | |
| return <ProfileScreen onNavigate={handleNavigate} /> | |
| case "Limits": | |
| return <LimitsScreen onNavigate={handleNavigate} /> | |
| case "Income": | |
| return <IncomeScreen onNavigate={handleNavigate} /> | |
| case "Notification": | |
| return <NotificationScreen onNavigate={handleNavigate} /> | |
| case "UserProfile": | |
| return <UserProfileScreen onNavigate={handleNavigate} /> | |
| case "BankAccounts": | |
| return <BankAccountsScreen onNavigate={handleNavigate} /> | |
| default: | |
| return <ProfileScreen onNavigate={handleNavigate} /> | |
| } | |
| } | |
| return renderScreen() | |
| } | |
| const ProfileAppContent: React.FC = () => { | |
| type Screen = "Profile" | "Limits" | "Income" | "Notification" | "UserProfile" | "BankAccounts" | |
| const [currentScreen, setCurrentScreen] = React.useState<Screen>("Profile") | |
| const handleNavigate = (screen: Screen) => { | |
| setCurrentScreen(screen) | |
| } | |
| const renderScreen = () => { | |
| switch (currentScreen) { | |
| case "Profile": | |
| return <ProfileScreen onNavigate={handleNavigate} /> | |
| case "Limits": | |
| return <LimitsScreen onNavigate={handleNavigate} /> | |
| case "Income": | |
| return <IncomeScreen onNavigate={handleNavigate} /> | |
| case "Notification": | |
| return <NotificationScreen onNavigate={handleNavigate} /> | |
| case "UserProfile": | |
| return <UserProfileScreen onNavigate={handleNavigate} /> | |
| case "BankAccounts": | |
| return <BankAccountsScreen onNavigate={handleNavigate} /> | |
| default: | |
| return <ProfileScreen onNavigate={handleNavigate} /> | |
| } | |
| } | |
| return renderScreen() | |
| } |
🤖 Prompt for AI Agents
In src/app/profile/index.tsx around lines 10 to 37, the component implements a
manual router via local state and onNavigate props; replace this with Expo
Router file-based routes: create separate route files (src/app/profile/index.tsx
as the menu and src/app/profile/limits.tsx, income.tsx, notification.tsx,
user.tsx, bank-accounts.tsx) and navigate between them using Expo Router
navigation/Link or Stack/Tabs, passing any required data via route params
instead of onNavigate callbacks; remove the local currentScreen state and
onNavigate props from the child screens (or convert them to accept params), and
if you stop using react-navigation directly, remove @react-navigation/native
from dependencies; if you temporarily keep the manual switch for an interim
change, at minimum tighten typing by creating a ScreenName union type and typing
handleNavigate and currentScreen accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Psamcyite make a route file for the navigation routes its much cleaner that way to handle if we face any errors in the future and also a good standard to maintain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,27 @@ export const AccountItem: React.FC<AccountItemProps> = ({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const Component = onPress ? TouchableOpacity : View | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const Component = onPress ? TouchableOpacity : View | |
| // Use explicit branches to avoid invalid props on View | |
| {onPress ? ( | |
| <TouchableOpacity | |
| onPress={onPress} | |
| activeOpacity={0.7} | |
| className="flex-row items-center rounded-xl border px-5 py-4" | |
| style={{ backgroundColor: colors.cardBackground, borderColor: colors.border }} | |
| > | |
| <View className="mr-4 h-10 w-10">{icon}</View> | |
| <AppText medium className="flex-1 text-base" style={{ color: colors.text }}> | |
| {name} | |
| </AppText> | |
| <IconWrapper height={40} width={60}> | |
| <AppText semibold className="text-base" style={{ color: colors.text }}> | |
| {amount} | |
| </AppText> | |
| </IconWrapper> | |
| </TouchableOpacity> | |
| ) : ( | |
| <View | |
| className="flex-row items-center rounded-xl border px-5 py-4" | |
| style={{ backgroundColor: colors.cardBackground, borderColor: colors.border }} | |
| > | |
| <View className="mr-4 h-10 w-10">{icon}</View> | |
| <AppText medium className="flex-1 text-base" style={{ color: colors.text }}> | |
| {name} | |
| </AppText> | |
| <IconWrapper height={40} width={60}> | |
| <AppText semibold className="text-base" style={{ color: colors.text }}> | |
| {amount} | |
| </AppText> | |
| </IconWrapper> | |
| </View> | |
| )} |
🤖 Prompt for AI Agents
In src/components/AccountItem.tsx around lines 24-25, you currently assign
Component = onPress ? TouchableOpacity : View and then always pass activeOpacity
which causes a prop/type mismatch; fix by either (A) rendering TouchableOpacity
conditionally only when onPress is present (i.e. return <TouchableOpacity ...>
when onPress else <View ...>), ensuring activeOpacity is only passed to
TouchableOpacity, or (B) switch to React Native Pressable for both cases and use
its supported props (remove activeOpacity and use press retention/opacity
styles), and update imports/types accordingly so TypeScript no longer complains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Treating every folder under src/ as a workspace package is risky for Expo/Metro.*
Metro + pnpm symlinks can misresolve modules unless you add custom metro.config and monorepo setup. Unless you truly have package boundaries in src/*, avoid making them workspace packages.
Recommended:
If you must keep monorepo in src/*, ensure Metro is configured (watchFolders, resolver.disableHierarchicalLookup=false or equivalent) and NativeWind/babel paths handle symlinks.
📝 Committable suggestion
🤖 Prompt for AI Agents