Skip to content

Commit ca98547

Browse files
authored
Merge pull request #1410 from peanutprotocol/feat/merchant-map-cta-home
[TASK-16465] Feat: Add merchant map CTA
2 parents e90ad59 + f8d169a commit ca98547

4 files changed

Lines changed: 32 additions & 4 deletions

File tree

redirects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"source": "/foodie",
50-
"destination": "https://peanutprotocol.notion.site/297838117579804da61dc45760a2599f?v=29783811757980a1b23a000cce31c330",
50+
"destination": "https://peanutprotocol.notion.site/Peanut-Foodie-Guide-29a83811757980e79896f2a610d6591a",
5151
"permanent": false
5252
}
5353
]

src/components/Home/HomeCarouselCTA/CarouselCTA.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface CarouselCTAProps {
1919
iconContainerClassName?: string
2020
// Notification-specific props
2121
isPermissionDenied?: boolean
22+
secondaryIcon?: StaticImageData | string
2223
}
2324

2425
const CarouselCTA = ({
@@ -30,6 +31,7 @@ const CarouselCTA = ({
3031
logo,
3132
iconContainerClassName,
3233
isPermissionDenied,
34+
secondaryIcon,
3335
}: CarouselCTAProps) => {
3436
const [showPermissionDeniedModal, setShowPermissionDeniedModal] = useState(false)
3537

@@ -87,15 +89,25 @@ const CarouselCTA = ({
8789
{/* Icon container */}
8890
<div
8991
className={twMerge(
90-
'flex size-8 items-center justify-center rounded-full',
92+
'relative flex size-8 items-center justify-center rounded-full',
9193
logo ? 'bg-transparent' : 'bg-primary-1',
9294
iconContainerClassName
9395
)}
9496
>
9597
{/* Show icon only if logo isn't provided. Logo takes precedence over icon. */}
96-
{!logo && <Icon name={icon} size={20} />}
98+
{!logo && <Icon name={icon} size={22} />}
9799
{logo && (
98-
<Image src={logo} alt={typeof title === 'string' ? title : 'logo'} width={32} height={32} />
100+
<Image src={logo} alt={typeof title === 'string' ? title : 'logo'} width={36} height={36} />
101+
)}
102+
{secondaryIcon && (
103+
<Image
104+
src={secondaryIcon}
105+
alt="secondary icon"
106+
height={64}
107+
width={64}
108+
quality={100}
109+
className="absolute -right-1 bottom-0 z-50 size-4 rounded-full object-cover"
110+
/>
99111
)}
100112
</div>
101113

src/components/Home/HomeCarouselCTA/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const HomeCarouselCTA = () => {
3131
logo={cta.logo}
3232
iconContainerClassName={cta.iconContainerClassName}
3333
isPermissionDenied={cta.isPermissionDenied}
34+
secondaryIcon={cta.secondaryIcon}
3435
/>
3536
))}
3637
</Carousel>

src/hooks/useHomeCarouselCTAs.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useNotifications } from './useNotifications'
77
import { useRouter } from 'next/navigation'
88
import useKycStatus from './useKycStatus'
99
import type { StaticImageData } from 'next/image'
10+
import { PIX } from '@/assets'
1011

1112
export type CarouselCTA = {
1213
id: string
@@ -19,6 +20,7 @@ export type CarouselCTA = {
1920
onClose?: () => void
2021
isPermissionDenied?: boolean
2122
iconContainerClassName?: string
23+
secondaryIcon?: StaticImageData | string
2224
}
2325

2426
export const useHomeCarouselCTAs = () => {
@@ -32,6 +34,19 @@ export const useHomeCarouselCTAs = () => {
3234
const generateCarouselCTAs = useCallback(() => {
3335
const _carouselCTAs: CarouselCTA[] = []
3436

37+
_carouselCTAs.push({
38+
id: 'merchant-map-pix',
39+
title: '20% Off with PIX Payments',
40+
description: 'Click to explore participating merchants. Pay with PIX QR, save instantly, earn points.',
41+
iconContainerClassName: 'bg-secondary-1',
42+
icon: 'shield',
43+
onClick: () => {
44+
router.push('https://peanutprotocol.notion.site/Peanut-Foodie-Guide-29a83811757980e79896f2a610d6591a')
45+
},
46+
logo: PIX,
47+
secondaryIcon: 'https://flagcdn.com/w320/br.png',
48+
})
49+
3550
// add notification prompt as first item if it should be shown
3651
if (showReminderBanner) {
3752
_carouselCTAs.push({

0 commit comments

Comments
 (0)