color, center, canceled, labeled, recognize and the rest, in UI text, help text, comments, docs and names (ColorInput, QrCenter). Migration 053 renames the two Site settings color CHECKs, whose names are the messages the admin shows. Kept: events.status's stored value 'cancelled' (shown as canceled), aria-labelledby, schema.org's EventCancelled, and old migrations as they ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
/* ═══════════════════════════════════════════════════════════════
|
|
ORG LOGO
|
|
|
|
An organization's logo, or its initials in a square in its color
|
|
when there's no file or it fails to load. Decorative: the name is
|
|
always right beside it. Used by the organization lists and the
|
|
group map.
|
|
═══════════════════════════════════════════════════════════════ */
|
|
|
|
import Logo from './Logo.tsx'
|
|
import { accentText } from '../lib/color.ts'
|
|
import { mediaUrl } from '../lib/media.ts'
|
|
import { initialsFor } from '../lib/organizations.ts'
|
|
|
|
export default function OrgLogo({
|
|
org,
|
|
color,
|
|
size = 'h-14 w-14',
|
|
}: {
|
|
org: { logo?: string | null; name: string }
|
|
color: string
|
|
size?: string
|
|
}) {
|
|
return (
|
|
<Logo
|
|
src={mediaUrl(org.logo)}
|
|
className={`${size} object-contain rounded-xl shrink-0`}
|
|
fallback={
|
|
<span
|
|
className={`${size} rounded-xl shrink-0 flex items-center justify-center font-extrabold`}
|
|
style={{ border: `1px solid ${color}`, color: accentText(color) }}
|
|
aria-hidden="true"
|
|
>
|
|
{initialsFor(org.name)}
|
|
</span>
|
|
}
|
|
/>
|
|
)
|
|
}
|