[fix] solution/frontend: 랜딩(/) 입력창·로그인 진입점을 ?build=1 뒤로 감춘다
/ 를 그냥 열면 히어로 입력 폼과 헤더 로그인 링크가 항상 떠 있었다. 사장님 지시로 ?build=1 쿼리가 있을 때만 두 진입점을 보여주고, 평소 / 는 보여주기 화면으로만 쓴다. - LandingPage.tsx: useSearchParams 로 buildMode 계산, 히어로 <form> 을 그 값으로 감싼다 - MarketingShell.tsx: showAuthCta prop 추가(기본 true) — 랜딩만 buildMode 를 그대로 넘긴다 SSR 출력으로 확인: / 는 "가게 이름을 입력하세요"·"로그인" 둘 다 없음, /?build=1 은 둘 다 있음. tsc 통과. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
b386982f34
commit
2252588bf2
@ -17,7 +17,13 @@ const NAV = [
|
||||
{to: '/pricing', label: '요금'},
|
||||
];
|
||||
|
||||
export function MarketingShell({children}: {children: ReactNode}) {
|
||||
export function MarketingShell({
|
||||
children,
|
||||
showAuthCta = true,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
showAuthCta?: boolean;
|
||||
}) {
|
||||
const user = useAuthStore((s) => s.user);
|
||||
|
||||
return (
|
||||
@ -52,7 +58,7 @@ export function MarketingShell({children}: {children: ReactNode}) {
|
||||
히어로의 큰 입력 카드가 이미 그 자리다 — 시작하는 문이 한 화면에 둘이면
|
||||
어느 쪽이 진짜인지 고르게 만든다. 헤더는 로그인만 받는다.
|
||||
*/}
|
||||
{user ? (
|
||||
{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"
|
||||
@ -66,7 +72,7 @@ export function MarketingShell({children}: {children: ReactNode}) {
|
||||
>
|
||||
로그인
|
||||
</Link>
|
||||
)}
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {useState, type FormEvent} from 'react';
|
||||
import {Link, useNavigate} from 'react-router';
|
||||
import {Link, useNavigate, useSearchParams} from 'react-router';
|
||||
import {ArrowRight, ArrowUp, Check} from 'lucide-react';
|
||||
import {MarketingShell, Section, SectionHead} from '@/components/layout/MarketingShell';
|
||||
import {ShowcaseGrid, ShowcasePeeks} from '@/features/marketing/ShowcaseGrid';
|
||||
@ -74,6 +74,8 @@ const HEADLINES = [
|
||||
export function LandingPage() {
|
||||
const navigate = useNavigate();
|
||||
const [query, setQuery] = useState('');
|
||||
const [searchParams] = useSearchParams();
|
||||
const buildMode = searchParams.get('build') === '1';
|
||||
|
||||
const submit = (event: FormEvent) => {
|
||||
event.preventDefault();
|
||||
@ -84,7 +86,7 @@ export function LandingPage() {
|
||||
};
|
||||
|
||||
return (
|
||||
<MarketingShell>
|
||||
<MarketingShell showAuthCta={buildMode}>
|
||||
{/* ── 상단 ─────────────────────────────────────── */}
|
||||
<section className="relative flex min-h-[calc(100dvh-4rem)] items-center overflow-hidden border-b border-border">
|
||||
<div className="mx-auto w-full max-w-6xl px-5 text-center">
|
||||
@ -112,6 +114,7 @@ export function LandingPage() {
|
||||
<ShowcasePeeks />
|
||||
</div>
|
||||
|
||||
{buildMode && (
|
||||
<form
|
||||
onSubmit={submit}
|
||||
className="relative z-10 mx-auto max-w-2xl rounded-2xl border border-border bg-card p-4 text-left shadow-[0_18px_50px_-20px_rgb(20_22_34/0.35)]"
|
||||
@ -151,6 +154,7 @@ export function LandingPage() {
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user