-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-11760] feat: return total transacted #883
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
""" WalkthroughThe changes add the display of total sent and received amounts to the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/components/Profile/components/PublicProfile.tsx (1)
103-120
: Consider component naming consistency and data consistency.Two concerns with this implementation:
Naming inconsistency: The component is called "PublicProfile" but now contains authenticated-only content. Consider renaming or restructuring.
Data consistency: The totals are fetched for all users but only displayed for authenticated users, which could be confusing.
Consider either:
- Renaming the component to reflect its mixed public/private nature
- Moving the authenticated content to a separate component
- Only fetching the sensitive data when the user is authenticated
useEffect(() => { + // Only fetch sensitive data if user is authenticated + const shouldFetchTotals = !!user + usersApi.getByUsername(username) .then((user) => { if (user?.fullName) setFullName(user.fullName) - if (user?.totalUsdSent) setTotalSent(user.totalUsdSent) - if (user?.totalUsdReceived) setTotalReceived(user.totalUsdReceived) + if (shouldFetchTotals && user?.totalUsdSent) setTotalSent(user.totalUsdSent) + if (shouldFetchTotals && user?.totalUsdReceived) setTotalReceived(user.totalUsdReceived) }) .catch((error) => { console.error('Failed to fetch user data:', error) }) -}, [username]) +}, [username, user])
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Profile/components/PublicProfile.tsx
(4 hunks)src/services/users.ts
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/Profile/components/PublicProfile.tsx (2)
src/context/authContext.tsx (1)
useAuth
(198-204)src/utils/general.utils.ts (1)
formatExtendedNumber
(997-1045)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Deploy-Preview
🔇 Additional comments (4)
src/services/users.ts (1)
28-29
: LGTM: New total amount fields added appropriately.The new string fields for tracking total USD sent and received are well-defined. Using strings for currency amounts is a good practice to avoid floating-point precision issues.
src/components/Profile/components/PublicProfile.tsx (3)
16-18
: LGTM: Appropriate imports added.The new imports for
formatExtendedNumber
,Card
, anduseAuth
are correctly added and align with the new functionality.
35-37
: LGTM: State variables and auth hook properly initialized.The state variables are appropriately initialized with default values, and the
useAuth
hook usage follows the expected pattern.
109-115
: LGTM: Proper formatting and display of total amounts.The use of
formatExtendedNumber
for currency formatting is appropriate, and the Card component structure follows the established pattern with proper positioning.
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.
@jjramirezn approved, resolve coderraabit comments before merge + consider showing txn stats only wen they are > 0
No description provided.