brand: real Hanzo mark + white-label env hooks
Replace the placeholder H badge with the canonical Hanzo mark (the
abstract H-shape from ~/work/hanzo/logo). Mark renders via
currentColor so it inherits whatever color the parent text sets —
no per-theme variants needed.
White-label is now fully driven by env:
NEXT_PUBLIC_APP_NAME full app name ('Hanzo Dataroom')
NEXT_PUBLIC_APP_NAME_PRIMARY first wordmark token (default: first
word of APP_NAME)
NEXT_PUBLIC_APP_NAME_SUFFIX remainder (default: rest of APP_NAME)
NEXT_PUBLIC_APP_TAGLINE sub-line under the welcome headline
NEXT_PUBLIC_IAM_PROVIDER_NAME IAM brand for 'Sign in with X' button
NEXT_PUBLIC_MARKETING_URL base URL for Terms / Privacy links
Tenants drop in their own NEXT_PUBLIC_APP_NAME='Acme Rooms' and the
whole page reads correctly with no code changes — wordmark + welcome
copy + terms attribution all pick up automatically. The mark itself
stays Hanzo (this IS a Hanzo app); tenants that need their own glyph
swap the HanzoMark import for a custom <img src=BRAND_LOGO_URL />.
Favicons regenerated from the canonical SVG too.
This commit is contained in:
@@ -6,13 +6,31 @@ import { useParams } from "next/navigation";
|
||||
import { signIn } from "next-auth/react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { HanzoMark } from "@/components/shared/icons/hanzo-mark";
|
||||
|
||||
const APP_NAME =
|
||||
process.env.NEXT_PUBLIC_APP_NAME || "Hanzo Dataroom";
|
||||
// White-label hooks: every visible brand token comes from env so tenants
|
||||
// drop in their own name/words/IAM provider without touching this file.
|
||||
//
|
||||
// NEXT_PUBLIC_APP_NAME e.g. "Hanzo Dataroom" | "Acme Rooms"
|
||||
// NEXT_PUBLIC_APP_NAME_PRIMARY first word of wordmark; defaults to first
|
||||
// word of NEXT_PUBLIC_APP_NAME ("Hanzo")
|
||||
// NEXT_PUBLIC_APP_NAME_SUFFIX second token of wordmark; defaults to
|
||||
// remainder of NEXT_PUBLIC_APP_NAME ("Dataroom")
|
||||
// NEXT_PUBLIC_APP_TAGLINE one-line under the welcome headline
|
||||
// NEXT_PUBLIC_IAM_PROVIDER_NAME IAM brand for the "Sign in with X" button
|
||||
// NEXT_PUBLIC_MARKETING_URL base URL the Terms / Privacy links resolve against
|
||||
|
||||
const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME || "Hanzo Dataroom";
|
||||
const [defaultPrimary, ...defaultSuffixParts] = APP_NAME.split(" ");
|
||||
const APP_NAME_PRIMARY =
|
||||
process.env.NEXT_PUBLIC_APP_NAME_PRIMARY || defaultPrimary || APP_NAME;
|
||||
const APP_NAME_SUFFIX =
|
||||
process.env.NEXT_PUBLIC_APP_NAME_SUFFIX || defaultSuffixParts.join(" ");
|
||||
const APP_TAGLINE =
|
||||
process.env.NEXT_PUBLIC_APP_TAGLINE || "Share documents. Not attachments.";
|
||||
const IAM_PROVIDER_NAME =
|
||||
process.env.NEXT_PUBLIC_IAM_PROVIDER_NAME || "Hanzo";
|
||||
const MARKETING_URL =
|
||||
process.env.NEXT_PUBLIC_MARKETING_URL || "";
|
||||
const MARKETING_URL = process.env.NEXT_PUBLIC_MARKETING_URL || "";
|
||||
|
||||
export default function Login() {
|
||||
const { next } = useParams as { next?: string };
|
||||
@@ -20,20 +38,20 @@ export default function Login() {
|
||||
return (
|
||||
<main className="flex min-h-screen w-full items-center justify-center bg-black px-6 text-white">
|
||||
<div className="w-full max-w-sm">
|
||||
<Link href="/" className="mb-12 block">
|
||||
<img
|
||||
src="/_static/hanzo-dataroom-logo-light.svg"
|
||||
alt={`${APP_NAME} Logo`}
|
||||
className="h-7 w-auto"
|
||||
/>
|
||||
<Link href="/" className="mb-12 flex items-center gap-3">
|
||||
<HanzoMark size={28} className="text-white" />
|
||||
<span className="text-base font-medium tracking-tight">
|
||||
{APP_NAME_PRIMARY}
|
||||
{APP_NAME_SUFFIX && (
|
||||
<span className="text-zinc-400"> {APP_NAME_SUFFIX}</span>
|
||||
)}
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
<h1 className="text-balance text-3xl font-semibold text-white">
|
||||
Welcome to {APP_NAME}
|
||||
</h1>
|
||||
<p className="mt-2 text-balance text-sm text-zinc-400">
|
||||
Share documents. Not attachments.
|
||||
</p>
|
||||
<p className="mt-2 text-balance text-sm text-zinc-400">{APP_TAGLINE}</p>
|
||||
|
||||
<Button
|
||||
onClick={() =>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// Canonical Hanzo mark — single-source SVG, mono via currentColor so it
|
||||
// adopts whatever text color its parent sets. This is the same vector
|
||||
// shipped in @hanzo/logo's docs/assets/hanzo-logo.svg, repainted to use
|
||||
// currentColor instead of #000/#666 so it composes cleanly into any
|
||||
// theme.
|
||||
//
|
||||
// White-label rule: this component renders the MARK only. The wordmark
|
||||
// (brand name + suffix) is rendered separately by the consumer using
|
||||
// process.env.NEXT_PUBLIC_APP_NAME so tenants can drop in their own
|
||||
// brand without forking the component.
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export type HanzoMarkProps = React.SVGProps<SVGSVGElement> & {
|
||||
size?: number;
|
||||
};
|
||||
|
||||
export function HanzoMark({
|
||||
size = 24,
|
||||
className,
|
||||
...props
|
||||
}: HanzoMarkProps) {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 67 67"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width={size}
|
||||
height={size}
|
||||
aria-label="Hanzo"
|
||||
className={cn("text-current", className)}
|
||||
{...props}
|
||||
>
|
||||
<path d="M22.21 67V44.6369H0V67H22.21Z" fill="currentColor" />
|
||||
<path
|
||||
d="M0 44.6369L22.21 46.8285V44.6369H0Z"
|
||||
fill="currentColor"
|
||||
opacity="0.4"
|
||||
/>
|
||||
<path
|
||||
d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M22.21 0H0V22.3184H22.21V0Z" fill="currentColor" />
|
||||
<path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="currentColor" />
|
||||
<path
|
||||
d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z"
|
||||
fill="currentColor"
|
||||
opacity="0.4"
|
||||
/>
|
||||
<path
|
||||
d="M66.7198 67V44.6369H44.5098V67H66.7198Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 279 KiB After Width: | Height: | Size: 279 KiB |
Reference in New Issue
Block a user