-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-13152] feat: add referral campaign modal #1005
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 ↗︎
|
""" WalkthroughA referral campaign feature is added to the mobile Home page, introducing a floating referral button and a modal dialog. Two new components, Changes
Estimated code review effort2 (~20 minutes) Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
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: 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
📒 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 memoizeshandleLinkCardClick
withdispatch
as the only dependency, following React best practices.
22-28
: Well-implemented URL parameter detection.The
useEffect
properly checks for thecreateLink=true
query parameter and triggers the link creation flow. The dependency array correctly includessearchParams
andhandleLinkCardClick
.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
No description provided.