Skip to content

Conversation

jjramirezn
Copy link
Contributor

No description provided.

@jjramirezn jjramirezn requested a review from Hugo0 July 22, 2025 03:15
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
peanut-wallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 1:27pm

Copy link

Implement Start Popup

Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

"""

Walkthrough

A referral campaign feature is added to the mobile Home page, introducing a floating referral button and a modal dialog. Two new components, FloatingReferralButton and ReferralCampaignModal, are created and integrated. The Send view is updated to handle a new query parameter createLink for referral link creation, triggering the relevant UI flow.

Changes

File(s) Change Summary
src/app/(mobile-ui)/home/page.tsx Integrates FloatingReferralButton and ReferralCampaignModal into the Home page with new state management.
src/components/Home/FloatingReferralButton/index.tsx Adds new FloatingReferralButton component with styling, animation, and click handler.
src/components/Home/ReferralCampaignModal/index.tsx Adds new ReferralCampaignModal component with campaign information, navigation, and modal control logic.
src/components/Send/views/SendRouter.view.tsx Updates to derive isSendingByLink from URL query parameter createLink, modifying navigation and state reset.

Estimated code review effort

2 (~20 minutes)

Suggested labels

enhancement
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 104a01f and 181d961.

📒 Files selected for processing (2)
  • src/components/Home/FloatingReferralButton/index.tsx (1 hunks)
  • src/components/Send/views/SendRouter.view.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/Home/FloatingReferralButton/index.tsx
  • src/components/Send/views/SendRouter.view.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Deploy-Preview
  • GitHub Check: test
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/referral-campaign

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Jul 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/components/Home/FloatingReferralButton/index.tsx (1)

11-11: Consider responsive positioning for the floating button.

The fixed positioning using left-[43%] top-[15%] may not work well across different screen sizes and orientations. Consider using responsive positioning or viewport-based units for better cross-device compatibility.

Consider using viewport units or responsive classes:

-            className="absolute left-[43%] top-[15%] z-50 animate-pulse cursor-pointer text-4xl transition-all duration-300 hover:scale-110 hover:animate-none"
+            className="absolute left-1/2 top-16 z-50 -translate-x-1/2 animate-pulse cursor-pointer text-4xl transition-all duration-300 hover:scale-110 hover:animate-none md:left-[43%] md:top-[15%] md:translate-x-0"
src/components/Home/ReferralCampaignModal/index.tsx (1)

54-69: Consider extracting hardcoded values for maintainability.

The modal implementation is well-structured, but consider making the reward amounts ($200, $5) configurable through props or environment variables for easier maintenance.

Consider extracting hardcoded values:

+interface ReferralCampaignModalProps {
+    visible: boolean
+    onClose: () => void
+    minDepositAmount?: number
+    bonusAmount?: number
+}

-const ReferralCampaignModal: React.FC<ReferralCampaignModalProps> = ({ visible, onClose }) => {
+const ReferralCampaignModal: React.FC<ReferralCampaignModalProps> = ({ 
+    visible, 
+    onClose, 
+    minDepositAmount = 200,
+    bonusAmount = 5 
+}) => {

Then use these values in the description text.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aee44eb and 104a01f.

📒 Files selected for processing (4)
  • src/app/(mobile-ui)/home/page.tsx (3 hunks)
  • src/components/Home/FloatingReferralButton/index.tsx (1 hunks)
  • src/components/Home/ReferralCampaignModal/index.tsx (1 hunks)
  • src/components/Send/views/SendRouter.view.tsx (1 hunks)
🧠 Learnings (4)
src/components/Home/FloatingReferralButton/index.tsx (5)

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: jjramirezn
PR: #495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the TokenAmountInput component (src/components/Global/TokenAmountInput/index.tsx), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:96-96
Timestamp: 2024-10-18T08:54:22.142Z
Learning: In the src/components/Offramp/Confirm.view.tsx file, it's acceptable to include crass or informal language in code comments.

Learnt from: jjramirezn
PR: #564
File: src/components/Request/Pay/Views/Initial.view.tsx:430-430
Timestamp: 2024-12-11T10:13:22.806Z
Learning: In the React TypeScript file src/components/Request/Pay/Views/Initial.view.tsx, when reviewing the InitialView component, do not flag potential issues with using non-null assertion ! on the slippagePercentage variable, as handling undefined values in this context is considered out of scope.

src/components/Send/views/SendRouter.view.tsx (10)

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: jjramirezn
PR: #469
File: src/app/request/pay/page.tsx:32-49
Timestamp: 2024-10-22T18:11:36.864Z
Learning: In src/app/request/pay/page.tsx, the id parameter is accessed via searchParams.id in the generateMetadata function.

Learnt from: jjramirezn
PR: #478
File: src/components/Request/Create/Views/Initial.view.tsx:169-176
Timestamp: 2024-10-24T12:45:22.708Z
Learning: When calling handleOnNext in src/components/Request/Create/Views/Initial.view.tsx, it's acceptable to duplicate parameter lists for readability instead of refactoring to avoid duplication.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: jjramirezn
PR: #469
File: src/app/request/pay/page.tsx:25-25
Timestamp: 2024-10-22T18:10:56.955Z
Learning: In the src/app/request/pay/page.tsx file, the PreviewType enum values are strings, so when adding previewType to URLSearchParams, there's no need to convert them to strings.

Learnt from: jjramirezn
PR: #551
File: src/components/Request/Create/Views/Initial.view.tsx:151-156
Timestamp: 2024-12-02T17:19:18.532Z
Learning: In the InitialView component at src/components/Request/Create/Views/Initial.view.tsx, when setting the default chain and token in the useEffect triggered by isPeanutWallet, it's acceptable to omit the setters from the dependency array and not include additional error handling for invalid defaults.

Learnt from: jjramirezn
PR: #484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the InitialCashoutView component (src/components/Cashout/Components/Initial.view.tsx), linked bank accounts should not generate error states, and the ValidatedInput component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.

Learnt from: jjramirezn
PR: #857
File: src/hooks/useWebSocket.ts:77-82
Timestamp: 2025-05-15T14:47:26.891Z
Learning: The useWebSocket hook in src/hooks/useWebSocket.ts is designed to provide raw history entries, while the components using it (such as HomeHistory.tsx) are responsible for implementing deduplication logic based on UUID to prevent duplicate entries when combining WebSocket data with other data sources.

Learnt from: jjramirezn
PR: #424
File: src/components/Global/TokenSelector/TokenSelector.tsx:197-211
Timestamp: 2024-10-11T01:14:15.489Z
Learning: In src/components/Global/TokenSelector/TokenSelector.tsx, when the calculation within functions like byChainAndText is not computationally expensive, it's acceptable to avoid using useCallback for memoization.

Learnt from: kushagrasarathe
PR: #828
File: src/app/(mobile-ui)/request/[...username]/page.tsx:17-17
Timestamp: 2025-05-02T19:14:25.010Z
Learning: In Next.js App Router, catch-all routes (like /request/[...username]) will only match URLs with at least one parameter segment, ensuring that the page component only renders when there is at least one value in the params array.

src/components/Home/ReferralCampaignModal/index.tsx (8)

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:96-96
Timestamp: 2024-10-18T08:54:22.142Z
Learning: In the src/components/Offramp/Confirm.view.tsx file, it's acceptable to include crass or informal language in code comments.

Learnt from: jjramirezn
PR: #478
File: src/components/Request/Create/Views/Initial.view.tsx:169-176
Timestamp: 2024-10-24T12:45:22.708Z
Learning: When calling handleOnNext in src/components/Request/Create/Views/Initial.view.tsx, it's acceptable to duplicate parameter lists for readability instead of refactoring to avoid duplication.

Learnt from: jjramirezn
PR: #564
File: src/components/Request/Pay/Views/Initial.view.tsx:430-430
Timestamp: 2024-12-11T10:13:22.806Z
Learning: In the React TypeScript file src/components/Request/Pay/Views/Initial.view.tsx, when reviewing the InitialView component, do not flag potential issues with using non-null assertion ! on the slippagePercentage variable, as handling undefined values in this context is considered out of scope.

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#0
File: :0-0
Timestamp: 2025-07-05T16:58:25.340Z
Learning: Hugo0 successfully refactored sessionStorage usage to React Context in the onramp flow, demonstrating preference for centralized state management over browser storage for component-shared state in React applications.

src/app/(mobile-ui)/home/page.tsx (7)

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#0
File: :0-0
Timestamp: 2025-07-05T16:58:25.340Z
Learning: Hugo0 successfully refactored sessionStorage usage to React Context in the onramp flow, demonstrating preference for centralized state management over browser storage for component-shared state in React applications.

Learnt from: jjramirezn
PR: #551
File: src/components/Request/Create/Views/Initial.view.tsx:151-156
Timestamp: 2024-12-02T17:19:18.532Z
Learning: In the InitialView component at src/components/Request/Create/Views/Initial.view.tsx, when setting the default chain and token in the useEffect triggered by isPeanutWallet, it's acceptable to omit the setters from the dependency array and not include additional error handling for invalid defaults.

Learnt from: jjramirezn
PR: #495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the TokenAmountInput component (src/components/Global/TokenAmountInput/index.tsx), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Learnt from: jjramirezn
PR: #484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the InitialCashoutView component (src/components/Cashout/Components/Initial.view.tsx), linked bank accounts should not generate error states, and the ValidatedInput component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.

🧰 Additional context used
🧠 Learnings (4)
src/components/Home/FloatingReferralButton/index.tsx (5)

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: jjramirezn
PR: #495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the TokenAmountInput component (src/components/Global/TokenAmountInput/index.tsx), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:96-96
Timestamp: 2024-10-18T08:54:22.142Z
Learning: In the src/components/Offramp/Confirm.view.tsx file, it's acceptable to include crass or informal language in code comments.

Learnt from: jjramirezn
PR: #564
File: src/components/Request/Pay/Views/Initial.view.tsx:430-430
Timestamp: 2024-12-11T10:13:22.806Z
Learning: In the React TypeScript file src/components/Request/Pay/Views/Initial.view.tsx, when reviewing the InitialView component, do not flag potential issues with using non-null assertion ! on the slippagePercentage variable, as handling undefined values in this context is considered out of scope.

src/components/Send/views/SendRouter.view.tsx (10)

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: jjramirezn
PR: #469
File: src/app/request/pay/page.tsx:32-49
Timestamp: 2024-10-22T18:11:36.864Z
Learning: In src/app/request/pay/page.tsx, the id parameter is accessed via searchParams.id in the generateMetadata function.

Learnt from: jjramirezn
PR: #478
File: src/components/Request/Create/Views/Initial.view.tsx:169-176
Timestamp: 2024-10-24T12:45:22.708Z
Learning: When calling handleOnNext in src/components/Request/Create/Views/Initial.view.tsx, it's acceptable to duplicate parameter lists for readability instead of refactoring to avoid duplication.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: jjramirezn
PR: #469
File: src/app/request/pay/page.tsx:25-25
Timestamp: 2024-10-22T18:10:56.955Z
Learning: In the src/app/request/pay/page.tsx file, the PreviewType enum values are strings, so when adding previewType to URLSearchParams, there's no need to convert them to strings.

Learnt from: jjramirezn
PR: #551
File: src/components/Request/Create/Views/Initial.view.tsx:151-156
Timestamp: 2024-12-02T17:19:18.532Z
Learning: In the InitialView component at src/components/Request/Create/Views/Initial.view.tsx, when setting the default chain and token in the useEffect triggered by isPeanutWallet, it's acceptable to omit the setters from the dependency array and not include additional error handling for invalid defaults.

Learnt from: jjramirezn
PR: #484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the InitialCashoutView component (src/components/Cashout/Components/Initial.view.tsx), linked bank accounts should not generate error states, and the ValidatedInput component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.

Learnt from: jjramirezn
PR: #857
File: src/hooks/useWebSocket.ts:77-82
Timestamp: 2025-05-15T14:47:26.891Z
Learning: The useWebSocket hook in src/hooks/useWebSocket.ts is designed to provide raw history entries, while the components using it (such as HomeHistory.tsx) are responsible for implementing deduplication logic based on UUID to prevent duplicate entries when combining WebSocket data with other data sources.

Learnt from: jjramirezn
PR: #424
File: src/components/Global/TokenSelector/TokenSelector.tsx:197-211
Timestamp: 2024-10-11T01:14:15.489Z
Learning: In src/components/Global/TokenSelector/TokenSelector.tsx, when the calculation within functions like byChainAndText is not computationally expensive, it's acceptable to avoid using useCallback for memoization.

Learnt from: kushagrasarathe
PR: #828
File: src/app/(mobile-ui)/request/[...username]/page.tsx:17-17
Timestamp: 2025-05-02T19:14:25.010Z
Learning: In Next.js App Router, catch-all routes (like /request/[...username]) will only match URLs with at least one parameter segment, ensuring that the page component only renders when there is at least one value in the params array.

src/components/Home/ReferralCampaignModal/index.tsx (8)

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: jjramirezn
PR: #495
File: src/components/Create/useCreateLink.tsx:647-657
Timestamp: 2024-10-29T16:06:38.812Z
Learning: In the React code for useCreateLink in src/components/Create/useCreateLink.tsx, the switchNetwork function used within useCallback hooks is stable and does not need to be included in the dependency arrays.

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:96-96
Timestamp: 2024-10-18T08:54:22.142Z
Learning: In the src/components/Offramp/Confirm.view.tsx file, it's acceptable to include crass or informal language in code comments.

Learnt from: jjramirezn
PR: #478
File: src/components/Request/Create/Views/Initial.view.tsx:169-176
Timestamp: 2024-10-24T12:45:22.708Z
Learning: When calling handleOnNext in src/components/Request/Create/Views/Initial.view.tsx, it's acceptable to duplicate parameter lists for readability instead of refactoring to avoid duplication.

Learnt from: jjramirezn
PR: #564
File: src/components/Request/Pay/Views/Initial.view.tsx:430-430
Timestamp: 2024-12-11T10:13:22.806Z
Learning: In the React TypeScript file src/components/Request/Pay/Views/Initial.view.tsx, when reviewing the InitialView component, do not flag potential issues with using non-null assertion ! on the slippagePercentage variable, as handling undefined values in this context is considered out of scope.

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#0
File: :0-0
Timestamp: 2025-07-05T16:58:25.340Z
Learning: Hugo0 successfully refactored sessionStorage usage to React Context in the onramp flow, demonstrating preference for centralized state management over browser storage for component-shared state in React applications.

src/app/(mobile-ui)/home/page.tsx (7)

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: kushagrasarathe
PR: #869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Learnt from: Hugo0
PR: #458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-10-18T01:51:35.247Z
Learning: The handleConfirm function in src/components/Create/Link/Confirm.view.tsx is separate from the one in src/components/Offramp/Confirm.view.tsx and does not need to be renamed when refactoring handleConfirm in src/components/Offramp/Confirm.view.tsx.

Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#0
File: :0-0
Timestamp: 2025-07-05T16:58:25.340Z
Learning: Hugo0 successfully refactored sessionStorage usage to React Context in the onramp flow, demonstrating preference for centralized state management over browser storage for component-shared state in React applications.

Learnt from: jjramirezn
PR: #551
File: src/components/Request/Create/Views/Initial.view.tsx:151-156
Timestamp: 2024-12-02T17:19:18.532Z
Learning: In the InitialView component at src/components/Request/Create/Views/Initial.view.tsx, when setting the default chain and token in the useEffect triggered by isPeanutWallet, it's acceptable to omit the setters from the dependency array and not include additional error handling for invalid defaults.

Learnt from: jjramirezn
PR: #495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the TokenAmountInput component (src/components/Global/TokenAmountInput/index.tsx), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Learnt from: jjramirezn
PR: #484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the InitialCashoutView component (src/components/Cashout/Components/Initial.view.tsx), linked bank accounts should not generate error states, and the ValidatedInput component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Deploy-Preview
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (10)
src/components/Home/FloatingReferralButton/index.tsx (1)

3-16: Good component structure and accessibility.

The component follows React best practices with a clear interface, proper accessibility labeling, and focused responsibility. The animation and hover effects provide good user feedback.

src/components/Send/views/SendRouter.view.tsx (3)

5-6: Good import additions for URL parameter handling.

The addition of useSearchParams import and React hooks is appropriate for the new functionality.


16-20: Proper memoization of callback function.

The useCallback correctly memoizes handleLinkCardClick with dispatch as the only dependency, following React best practices.


22-28: Well-implemented URL parameter detection.

The useEffect properly checks for the createLink=true query parameter and triggers the link creation flow. The dependency array correctly includes searchParams and handleLinkCardClick.

src/app/(mobile-ui)/home/page.tsx (3)

35-36: Good component imports for referral feature.

The imports are properly structured and follow the existing patterns in the file.


62-62: Consistent state management pattern.

The new state variable follows the same naming and initialization pattern as other modal states in the component.


231-238: Well-integrated modal and button components.

The referral campaign modal and floating button are properly integrated following the same patterns as other modals in the component. The event handlers are clean and focused.

src/components/Home/ReferralCampaignModal/index.tsx (3)

16-19: Clean navigation handler implementation.

The handleInviteFriends function properly navigates to the send flow with the correct query parameter and closes the modal. The implementation is straightforward and effective.


21-34: Well-structured call-to-action buttons.

The CTA configuration is comprehensive and follows the ActionModal interface correctly. The button styling and behavior are appropriate for the use case.


36-52: Comprehensive and informative content.

The title, description, and steps provide clear information about the referral program. The ordered list makes the process easy to understand, and the timing note about Monday calculations is helpful for user expectations.

Also fix back button on send link flow
@jjramirezn jjramirezn merged commit ff7be9c into peanut-wallet Jul 22, 2025
9 checks passed
@jjramirezn jjramirezn deleted the feat/referral-campaign branch July 22, 2025 13:45
This was referenced Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants