Skip to content

Commit f421eeb

Browse files
committed
Store and use ads cta field
1 parent fe1a664 commit f421eeb

File tree

7 files changed

+2800
-4
lines changed

7 files changed

+2800
-4
lines changed

cli/src/components/ad-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const AdBanner: React.FC<AdBannerProps> = ({ ad }) => {
4242

4343
// Use 'url' field for display domain (the actual destination)
4444
const domain = extractDomain(ad.url)
45-
// Use title as CTA, with fallback for empty titles
46-
const ctaText = ad.title || 'Learn more'
45+
// Use cta field for button text, with title as fallback
46+
const ctaText = ad.cta || ad.title || 'Learn more'
4747

4848
// Calculate available width for ad text
4949
// Account for: padding (2), "Ad" label with space (3)

cli/src/hooks/use-gravity-ad.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const MAX_ADS_AFTER_ACTIVITY = 3 // Show up to 3 ads after last activity, then s
1414
export type AdResponse = {
1515
adText: string
1616
title: string
17+
cta: string
1718
url: string
1819
favicon: string
1920
clickUrl: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "ad_impression" ADD COLUMN "cta" text NOT NULL DEFAULT '';

0 commit comments

Comments
 (0)