Skip to content

[TASK-16465] Feat: Add merchant map CTA#1410

Merged
Zishan-7 merged 2 commits intopeanut-walletfrom
feat/merchant-map-cta-home
Nov 6, 2025
Merged

[TASK-16465] Feat: Add merchant map CTA#1410
Zishan-7 merged 2 commits intopeanut-walletfrom
feat/merchant-map-cta-home

Conversation

@Zishan-7
Copy link
Contributor

@Zishan-7 Zishan-7 commented Nov 6, 2025

No description provided.

@vercel
Copy link

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Nov 6, 2025 5:11pm

@notion-workspace
Copy link

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Warning

Rate limit exceeded

@Zishan-7 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5546577 and f8d169a.

📒 Files selected for processing (1)
  • src/components/Home/HomeCarouselCTA/CarouselCTA.tsx (3 hunks)

Walkthrough

This PR updates the "/foodie" redirect destination in redirects.json and adds support for secondary icons in carousel CTAs. A new PIX payment promotion CTA is introduced featuring a logo and Brazilian flag icon.

Changes

Cohort / File(s) Summary
Redirect configuration
redirects.json
Updated the destination URL for the "/foodie" redirect entry from a parameterized Notion ID to a more descriptive URL format with "Peanut-Foodie-Guide" in the path.
CarouselCTA component enhancements
src/components/Home/HomeCarouselCTA/CarouselCTA.tsx, src/components/Home/HomeCarouselCTA/index.tsx
Added optional secondaryIcon prop (StaticImageData or string) to CarouselCTA component. Updated icon container positioning, increased icon size from 20 to 22 (without logo), increased logo size from 32x32 to 36x36, and added absolute-positioned Image rendering for secondary icon when provided. Prop is threaded through the parent component from CTA data.
Carousel CTA hook and type definition
src/hooks/useHomeCarouselCTAs.tsx
Added optional secondaryIcon field to CarouselCTA type. Introduced new CTA entry ("merchant-map-pix") offering 20% off with PIX payments, featuring PIX logo and Brazilian flag secondary icon.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify secondary icon positioning, sizing (64x64), and CSS classes (rounded-full, object-cover, absolute positioning) render correctly across different icon/logo combinations
  • Confirm prop threading consistency across CarouselCTA, index.tsx, and useHomeCarouselCTAs for the secondaryIcon property
  • Validate the new PIX CTA entry is correctly integrated into the carousel flow and placed before conditional prompts as intended
  • Check that the existing logo/icon precedence logic remains unaffected by the new conditional rendering branch

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Hugo0

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author. Add a description explaining the purpose, implementation details, and testing approach for the merchant map CTA feature.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding a merchant map CTA component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Nov 6, 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: 2

🧹 Nitpick comments (2)
src/components/Home/HomeCarouselCTA/CarouselCTA.tsx (2)

106-107: Optimize image dimensions to match rendered size.

The image is rendered at 16×16px (size-4) but requests 64×64px, resulting in unnecessary bandwidth usage. Specify dimensions closer to the rendered size.

Apply this diff:

                             alt="secondary icon"
-                            height={64}
-                            width={64}
+                            height={16}
+                            width={16}
                             quality={100}

105-105: Improve alt text for better accessibility.

The generic alt text "secondary icon" doesn't describe what the icon represents. Consider making it more descriptive (e.g., "Brazil flag" for country-specific promotions) or deriving it from context.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e90ad59 and 5546577.

📒 Files selected for processing (4)
  • redirects.json (1 hunks)
  • src/components/Home/HomeCarouselCTA/CarouselCTA.tsx (3 hunks)
  • src/components/Home/HomeCarouselCTA/index.tsx (1 hunks)
  • src/hooks/useHomeCarouselCTAs.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: jjramirezn
Repo: peanutprotocol/peanut-ui PR: 1190
File: src/app/(mobile-ui)/qr-pay/page.tsx:156-176
Timestamp: 2025-09-08T03:13:09.111Z
Learning: In the peanut-ui mobile app, the `/qr-pay` route is only accessed through the DirectSendQR component which always includes the qrCode parameter in the URL when redirecting users to the QR pay page after scanning MERCADO_PAGO or PIX QR codes.
📚 Learning: 2025-07-24T13:26:10.290Z
Learnt from: Hugo0
Repo: peanutprotocol/peanut-ui PR: 1014
File: src/components/Claim/Link/Initial.view.tsx:413-413
Timestamp: 2025-07-24T13:26:10.290Z
Learning: In the peanut-ui repository, the change from `${SQUID_API_URL}/route` to `${SQUID_API_URL}/v2/route` in src/components/Claim/Link/Initial.view.tsx was a typo fix, not an API migration, as the codebase was already using Squid API v2.

Applied to files:

  • redirects.json
🧬 Code graph analysis (1)
src/components/Home/HomeCarouselCTA/CarouselCTA.tsx (1)
src/components/Global/Icons/Icon.tsx (1)
  • Icon (209-218)
🔇 Additional comments (6)
redirects.json (1)

50-50: LGTM!

The redirect URL update to include the full Notion page title improves readability and maintainability.

src/components/Home/HomeCarouselCTA/index.tsx (1)

34-34: LGTM!

The secondaryIcon prop is correctly propagated from the CTA data to the CarouselCTA component.

src/hooks/useHomeCarouselCTAs.tsx (2)

37-48: Verify the intentional ordering of the PIX promo CTA.

The new merchant-map-pix CTA is added before the notification and KYC prompts, meaning it will always appear first in the carousel. Please confirm this is the intended priority.


47-47: Consider using a local asset instead of an external CDN URL.

Using an external CDN URL for the flag icon introduces several concerns:

  • Network dependency: The image will fail to load if the CDN is unavailable, the user is offline, or the service blocks the domain
  • Performance: Requires additional DNS lookup and HTTP request
  • No error handling or fallback if the image fails to load

Consider importing a local flag asset similar to how PIX is imported.

⛔ Skipped due to learnings
Learnt from: Zishan-7
Repo: peanutprotocol/peanut-ui PR: 1098
File: src/components/LandingPage/noFees.tsx:243-248
Timestamp: 2025-08-15T08:05:05.417Z
Learning: In the peanut-ui project, when displaying country flags from external CDNs like flagcdn.com, the preference is to show country-specific images without fallback handling. The team prioritizes showing accurate country flags over having generic fallback images.
src/components/Home/HomeCarouselCTA/CarouselCTA.tsx (2)

98-100: LGTM with note on size changes.

The icon and logo size increases (22px and 36px respectively) provide better visual hierarchy.


109-109: Review z-index hierarchy for potential conflicts.

The z-50 value is significantly higher than the close button's z-10. While this ensures the secondary icon appears above the primary icon, verify it doesn't inadvertently overlap or conflict with other UI elements like the close button.

@Zishan-7 Zishan-7 merged commit ca98547 into peanut-wallet Nov 6, 2025
5 checks passed
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