From a9793a5ad2bb7aaae3c0f91c0460b704a2adb1d3 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sun, 21 Jun 2026 16:23:24 +0200 Subject: [PATCH] =?UTF-8?q?fix(ads):=20AdCard=20matches=20PostCard=20layou?= =?UTF-8?q?t=20=E2=80=94=20same=20header,=20image,=20footer=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/feed/AdCard.tsx | 107 ++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/src/components/feed/AdCard.tsx b/src/components/feed/AdCard.tsx index a9d969e..8995eb9 100644 --- a/src/components/feed/AdCard.tsx +++ b/src/components/feed/AdCard.tsx @@ -14,62 +14,71 @@ type AdCardAd = { export function AdCard({ ad }: { ad: AdCardAd }) { const imageUrl = getMediaUrl(ad.imageKey); - const inner = ( -
- {/* Image */} - {imageUrl && ( - // eslint-disable-next-line @next/next/no-img-element - {ad.title} - )} + return ( +
+ {/* Header — mirrors PostCard layout */} +
+ {/* Sponsor "avatar" — orange circle with paw */} +
+ +
- {/* Text area */} -
- {/* Sponsored badge row */} -
- - Sponsored - + {/* Name + badge row */} +
+
+

+ {ad.title} +

+ + Sponsored + +
{ad.targetUrl && ( - +

+ {ad.targetUrl.replace(/^https?:\/\//, "").replace(/\/$/, "")} +

)}
-

- {ad.title} -

- - {ad.caption && ( -

- {ad.caption} -

- )} - + {/* External link button — mirrors options button position */} {ad.targetUrl && ( -

- {ad.targetUrl.replace(/^https?:\/\//, "")} -

+ + )}
-
+ + {/* Image area — same dimensions as PostCard single image */} + {imageUrl && ( + + {/* eslint-disable-next-line @next/next/no-img-element */} + {ad.title} + + )} + + {/* Footer — caption only, mirrors PostCard footer */} + {ad.caption && ( +
+

{ad.caption}

+
+ )} +
); - - if (ad.targetUrl) { - return ( - - {inner} - - ); - } - - return inner; }