Content Partners: match Broadcast Beat partner logos (bb schema + broadcastbeat advertisers)
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -39,4 +39,6 @@ jest-test-results.json
|
||||
.idea/
|
||||
|
||||
# Optional: if using TurboRepo or monorepo
|
||||
turbo/
|
||||
turbo/
|
||||
# Legacy WP uploads served from Supabase/CDN, not git
|
||||
public/wp-content/uploads/
|
||||
|
||||
@@ -7,19 +7,22 @@ type Sponsor = {
|
||||
logoUrl: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Content Partners strip — mirrors Broadcast Beat partner list (bb schema +
|
||||
* broadcastbeat advertisers) so both RMP sites show the same logos.
|
||||
*/
|
||||
async function fetchSponsors(): Promise<Sponsor[]> {
|
||||
try {
|
||||
const adv = createAdminClient("adv");
|
||||
const { data: ads } = await adv
|
||||
.from("active_advertisers_by_property")
|
||||
.select("company_name_lower")
|
||||
.eq("property", "avbeat");
|
||||
.eq("property", "broadcastbeat");
|
||||
const names = Array.from(new Set((ads || []).map((r: any) => String(r.company_name_lower))));
|
||||
|
||||
const bb = createAdminClient();
|
||||
const bb = createAdminClient("bb");
|
||||
const bySlug = new Map<string, Sponsor>();
|
||||
|
||||
// Layer 1 — currently active advertisers.
|
||||
if (names.length > 0) {
|
||||
const { data: dir } = await bb
|
||||
.from("tracked_companies")
|
||||
@@ -43,8 +46,6 @@ async function fetchSponsors(): Promise<Sponsor[]> {
|
||||
}
|
||||
}
|
||||
|
||||
// Layer 2 — pinned content partners (directory.featured=true). These
|
||||
// surface here whether or not they have an active ad campaign.
|
||||
const { data: pinned } = await bb
|
||||
.from("tracked_companies")
|
||||
.select("slug, company_name, logo_url")
|
||||
@@ -68,12 +69,12 @@ export default async function SponsorLogoStrip() {
|
||||
if (sponsors.length === 0) return null;
|
||||
|
||||
return (
|
||||
<section className="max-w-container mx-auto px-4 py-6 border-t border-b border-[#FFFFFF]" aria-label="Content partners">
|
||||
<section className="max-w-container mx-auto px-4 py-6 border-t border-b border-[#DCE6F2]" aria-label="Content partners">
|
||||
<div className="flex items-center gap-4 mb-3">
|
||||
<span className="text-[10px] uppercase tracking-widest text-[#1D4ED8] font-bold">
|
||||
Content Partners
|
||||
</span>
|
||||
<div className="flex-1 h-px bg-[#FFFFFF]" />
|
||||
<div className="flex-1 h-px bg-[#DCE6F2]" />
|
||||
<Link href="/advertise" className="text-[10px] text-[#666] hover:text-[#1D4ED8] font-mono">
|
||||
Advertise →
|
||||
</Link>
|
||||
@@ -99,4 +100,4 @@ export default async function SponsorLogoStrip() {
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user