Manufacturer profile: fix light-theme text contrast and BMD logo
This commit is contained in:
@@ -10,6 +10,14 @@ export const revalidate = 1800;
|
||||
|
||||
type Params = { slug: string };
|
||||
|
||||
const LOGO_OVERRIDES: Record<string, string> = {
|
||||
"blackmagic-design": "/img/partners/blackmagic-design.png",
|
||||
};
|
||||
|
||||
function resolveLogoUrl(slug: string, logoUrl: string | null | undefined): string | null {
|
||||
return LOGO_OVERRIDES[slug] || logoUrl || null;
|
||||
}
|
||||
|
||||
// Known show date ranges. Booth numbers only render when the show is
|
||||
// upcoming within 90 days; otherwise the row is shown without a booth.
|
||||
const SHOW_DATES: Record<string, { start: string; end: string }> = {
|
||||
@@ -172,12 +180,12 @@ export default async function ManufacturerProfile({
|
||||
|
||||
<header className="flex flex-col sm:flex-row gap-6 mb-8 pb-8 border-b border-[#DCE6F2]">
|
||||
<div className="w-24 h-24 rounded-xl bg-[#FFFFFF] flex items-center justify-center overflow-hidden flex-shrink-0">
|
||||
{company.logo_url ? (
|
||||
{resolveLogoUrl(slug, company.logo_url) ? (
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
<img
|
||||
src={company.logo_url}
|
||||
src={resolveLogoUrl(slug, company.logo_url)!}
|
||||
alt={`${company.company_name} logo`}
|
||||
className="w-full h-full object-contain"
|
||||
className="w-full h-full object-contain p-1"
|
||||
/>
|
||||
) : (
|
||||
<span className="text-[#666] text-3xl font-bold">
|
||||
@@ -186,17 +194,17 @@ export default async function ManufacturerProfile({
|
||||
)}
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<h1 className="text-3xl md:text-4xl font-display font-bold text-[#e0e0e0] mb-1">
|
||||
<h1 className="text-3xl md:text-4xl font-display font-bold text-[#0F172A] mb-1">
|
||||
{company.company_name}
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 flex-wrap text-xs">
|
||||
{company.exhibits_nab && (
|
||||
<span className="bg-amber-500/15 text-amber-300 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
<span className="bg-amber-50 text-amber-700 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
2026 NAB Show
|
||||
</span>
|
||||
)}
|
||||
{company.exhibits_ibc && (
|
||||
<span className="bg-blue-500/15 text-blue-300 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
<span className="bg-blue-50 text-blue-700 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
IBC 2026
|
||||
</span>
|
||||
)}
|
||||
@@ -268,8 +276,8 @@ export default async function ManufacturerProfile({
|
||||
|
||||
{company.bio && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-2">About</h2>
|
||||
<div className="text-[#ccc] leading-relaxed space-y-4 whitespace-pre-line">{company.bio}</div>
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-2">About</h2>
|
||||
<div className="text-[#475569] leading-relaxed space-y-4 whitespace-pre-line">{company.bio}</div>
|
||||
{company.bio_source && (
|
||||
<p className="text-xs text-[#666] mt-2">
|
||||
Source: {company.bio_source}
|
||||
@@ -280,10 +288,10 @@ export default async function ManufacturerProfile({
|
||||
|
||||
{executives.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-4">Executive leadership</h2>
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-4">Executive leadership</h2>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{executives.map((e: any) => (
|
||||
<div key={e.id} className="bg-[#111] border border-[#DCE6F2] rounded-lg p-4 flex gap-3">
|
||||
<div key={e.id} className="bg-white border border-[#DCE6F2] rounded-lg p-4 flex gap-3">
|
||||
{e.photo_url ? (
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
<img
|
||||
@@ -298,9 +306,9 @@ export default async function ManufacturerProfile({
|
||||
</div>
|
||||
)}
|
||||
<div className="min-w-0">
|
||||
<div className="font-semibold text-[#e0e0e0] truncate">{e.name}</div>
|
||||
<div className="font-semibold text-[#0F172A] truncate">{e.name}</div>
|
||||
{e.title && <div className="text-xs text-[#888] mb-1">{e.title}</div>}
|
||||
{e.bio && <p className="text-xs text-[#aaa] line-clamp-3 mb-1">{e.bio}</p>}
|
||||
{e.bio && <p className="text-xs text-[#64748B] line-clamp-3 mb-1">{e.bio}</p>}
|
||||
{e.linkedin_url && (
|
||||
<a
|
||||
href={e.linkedin_url}
|
||||
@@ -320,8 +328,8 @@ export default async function ManufacturerProfile({
|
||||
|
||||
{(company.hq_address || company.phone || company.contact_email) && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-2">Headquarters</h2>
|
||||
<address className="not-italic text-[#ccc] text-sm leading-relaxed">
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-2">Headquarters</h2>
|
||||
<address className="not-italic text-[#475569] text-sm leading-relaxed">
|
||||
{company.hq_address && <div>{company.hq_address}</div>}
|
||||
{(company.hq_city || company.hq_country) && (
|
||||
<div>{[company.hq_city, company.hq_country].filter(Boolean).join(", ")}</div>
|
||||
@@ -351,12 +359,12 @@ export default async function ManufacturerProfile({
|
||||
if (cleanCategories.length === 0) return null;
|
||||
return (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-2">Categories</h2>
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-2">Categories</h2>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{cleanCategories.map((c: string) => (
|
||||
<span
|
||||
key={c}
|
||||
className="text-xs bg-[#FFFFFF] text-[#aaa] px-2.5 py-1 rounded-full"
|
||||
className="text-xs bg-[#EEF2F6] text-[#475569] px-2.5 py-1 rounded-full border border-[#DCE6F2]"
|
||||
>
|
||||
{c}
|
||||
</span>
|
||||
@@ -368,7 +376,7 @@ export default async function ManufacturerProfile({
|
||||
|
||||
{shows.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-3">
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-3">
|
||||
Trade-show appearances
|
||||
</h2>
|
||||
<ul className="space-y-2">
|
||||
@@ -382,10 +390,10 @@ export default async function ManufacturerProfile({
|
||||
return (
|
||||
<li
|
||||
key={`${s.show}-${s.show_year}-${s.booth || "?"}`}
|
||||
className="bg-[#111] border border-[#DCE6F2] rounded-md px-4 py-3 flex items-center justify-between gap-4"
|
||||
className="bg-white border border-[#DCE6F2] rounded-md px-4 py-3 flex items-center justify-between gap-4"
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<span className="font-semibold text-[#e0e0e0]">{label}</span>
|
||||
<span className="font-semibold text-[#0F172A]">{label}</span>
|
||||
{renderBooth && (
|
||||
<span className="ml-3 text-sm text-[#888]">Booth {cleanBooth}</span>
|
||||
)}
|
||||
@@ -400,7 +408,7 @@ export default async function ManufacturerProfile({
|
||||
{recentStories.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<header className="flex items-baseline justify-between mb-3">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0]">Recent coverage</h2>
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A]">Recent coverage</h2>
|
||||
<Link href={`/news?search=${encodeURIComponent(company.company_name)}`} className="text-xs text-[#1D4ED8] hover:underline">
|
||||
All stories →
|
||||
</Link>
|
||||
@@ -410,20 +418,20 @@ export default async function ManufacturerProfile({
|
||||
<Link
|
||||
key={r.wp_slug}
|
||||
href={`/news/${r.wp_slug}`}
|
||||
className="group bg-[#F8FAFC] border border-[#DCE6F2] rounded-md p-3 hover:border-[#1D4ED8] hover:shadow-sm transition-all flex gap-3"
|
||||
className="group bg-white border border-[#DCE6F2] rounded-md p-3 hover:border-[#1D4ED8] hover:shadow-sm transition-all flex gap-3"
|
||||
>
|
||||
{/* Image fallback cascade — Ryan rule: never show an empty
|
||||
gray box on a coverage card. Falls through:
|
||||
article featured_image → company logo → static placeholder. */}
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={r.featured_image || company.logo_url || '/assets/images/article-placeholder-v2.svg'}
|
||||
src={r.featured_image || resolveLogoUrl(slug, company.logo_url) || '/assets/images/article-placeholder-v2.svg'}
|
||||
alt=""
|
||||
className="w-20 h-14 rounded object-cover bg-[#FFFFFF] flex-shrink-0"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div className="min-w-0">
|
||||
<h3 className="text-xs font-semibold text-[#e0e0e0] leading-snug group-hover:text-[#1D4ED8] line-clamp-3">
|
||||
<h3 className="text-xs font-semibold text-[#0F172A] leading-snug group-hover:text-[#1D4ED8] line-clamp-3">
|
||||
{r.title}
|
||||
</h3>
|
||||
{r.wp_published_at && (
|
||||
@@ -440,7 +448,7 @@ export default async function ManufacturerProfile({
|
||||
|
||||
{pressReleases.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-[#e0e0e0] mb-3">Press releases</h2>
|
||||
<h2 className="text-lg font-display font-bold text-[#0F172A] mb-3">Press releases</h2>
|
||||
<ul className="space-y-2">
|
||||
{pressReleases.map((p) => (
|
||||
<li key={p.slug || p.source_url} className="text-sm">
|
||||
@@ -452,7 +460,7 @@ export default async function ManufacturerProfile({
|
||||
{p.title}
|
||||
</Link>
|
||||
) : (
|
||||
<span>{p.title}</span>
|
||||
<span className="text-[#475569]">{p.title}</span>
|
||||
)}
|
||||
{p.published_at && (
|
||||
<span className="text-[#888] text-xs ml-2">
|
||||
|
||||
Reference in New Issue
Block a user