Files
o2o-site-AEO/solution/frontend/src/components/layout/MarketingShell.tsx
T
minaChoiandClaude Opus 5.5 11d30bb3d1 [chore] solution,admin,ontology: 코드 주석을 한 줄로 — 히스토리 주석 삭제
여러 줄 주석이 설명보다 경위(예전·실측·지적)를 적고 있어 읽는 사람이 결론을 찾기 어려웠다.

- ts·tsx·js·mjs·css·py 478개: 여러 줄 주석은 첫 문장 한 줄로, 과거형·날짜 문장은 삭제
- 주석 위치는 TypeScript 파서·파이썬 tokenize/ast 로 찾는다 — 문자열 안의 # · /* 는 건드리지 않는다
- eslint·ts·noqa·type: ignore 같은 지시 주석은 그대로 둔다

파이썬 275개 정리 전후 AST 동일, TS 298개 주석 뺀 토큰 동일(빈 JSX 주석 10곳만 차이).
site·frontend·admin tsc, site vitest 105 passed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 16:05:19 +09:00

111 lines
3.7 KiB
TypeScript

import type {ReactNode} from 'react';
import {Link, NavLink} from 'react-router';
import {cn} from '@/lib/utils';
import {useAuthStore} from '@/stores/auth';
/** 로그인 전 화면(랜딩·요금·쇼케이스)의 껍데기. */
const NAV = [
{to: '/showcase', label: '이렇게 나옵니다'},
{to: '/pricing', label: '요금'},
];
export function MarketingShell({
children,
showAuthCta = true,
}: {
children: ReactNode;
showAuthCta?: boolean;
}) {
const user = useAuthStore((s) => s.user);
return (
<div className="min-h-screen bg-background text-foreground">
<header className="sticky top-0 z-20 border-b border-border bg-background/85 backdrop-blur">
<div className="mx-auto flex h-16 w-full max-w-6xl items-center gap-8 px-5">
<Link to="/" className="flex items-center">
<img src="/brand/web4ai-wordmark.svg" alt="Web4Ai" className="h-8 w-auto" />
</Link>
<nav className="hidden items-center gap-6 sm:flex">
{NAV.map(({to, label}) => (
<NavLink
key={to}
to={to}
className={({isActive}) =>
cn(
'text-sm font-medium transition-colors',
isActive ? 'text-foreground' : 'text-muted-foreground hover:text-foreground',
)
}
>
{label}
</NavLink>
))}
</nav>
<div className="ml-auto flex items-center gap-3">
{/* 이미 사이트를 가진 사장님에게 [로그인] 을 다시 보여주지 않는다 — 갈 곳은 내 사이트다. */}
{showAuthCta && (user ? (
<Link
to="/sites"
className="rounded-md bg-primary px-4 py-2 text-[13px] font-medium text-primary-foreground transition-colors hover:bg-primary/90"
>
내 사이트
</Link>
) : (
<Link
to="/login"
className="rounded-md border border-border px-4 py-2 text-[13px] font-medium transition-colors hover:bg-muted"
>
로그인
</Link>
))}
</div>
</div>
</header>
<main>{children}</main>
<footer className="mt-24 border-t border-border">
<div className="mx-auto flex w-full max-w-6xl flex-col gap-3 px-5 py-10 text-xs text-muted-foreground sm:flex-row sm:items-center sm:justify-between">
<img src="/brand/web4ai-wordmark.svg" alt="Web4Ai" className="h-6 w-auto opacity-60" />
<div className="flex gap-5">
{NAV.map(({to, label}) => (
<Link key={to} to={to} className="transition-colors hover:text-foreground">
{label}
</Link>
))}
</div>
</div>
</footer>
</div>
);
}
/** 랜딩의 한 켜. */
export function Section({
children,
className,
muted = false,
}: {
children: ReactNode;
className?: string;
muted?: boolean;
}) {
return (
<section className={cn('border-b border-border', muted && 'bg-muted/40')}>
<div className={cn('mx-auto w-full max-w-6xl px-5 py-16 sm:py-20', className)}>{children}</div>
</section>
);
}
export function SectionHead({eyebrow, title, description}: {eyebrow?: string; title: string; description?: string}) {
return (
<header className="mb-10 max-w-2xl">
{eyebrow && <p className="mb-2 text-xs font-medium tracking-wide text-muted-foreground">{eyebrow}</p>}
<h2 className="text-2xl font-bold tracking-tight text-balance sm:text-3xl">{title}</h2>
{description && <p className="mt-3 text-sm leading-relaxed text-muted-foreground">{description}</p>}
</header>
);
}