Files
o2o-infinith-demo/src/pages/LoginPage.tsx
T
Haewon KamandClaude Opus 5.5 845df72848 fix: 로그인 화면의 동작하지 않는 mailto 문의 링크를 뺀다
메일 앱이 없는 환경에서는 눌러도 아무 일이 없었다. 문의는 헤더·푸터의 문의하기(서식)로 받는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:33:38 +09:00

118 lines
4.4 KiB
TypeScript

/**
* LoginPage — 계약 병원 전용 로그인 (스캐폴딩).
*
* 현재 상태:
* - UI·라우트 스캐폴딩만 제공합니다. 실제 Supabase Auth 연동은 후속 작업입니다.
* - 제출 시 안내 메시지만 표시하고, 리드는 문의하기로 유도합니다.
*
* 향후 작업:
* - Supabase `signInWithPassword` 연동
* - 세션 훅 (`useSession`) + ProtectedRoute 적용
* - 로그인 후 대시보드 리다이렉트
*/
import { useState, type FormEvent } from 'react';
import { Link } from 'react-router';
import { ArrowRight } from 'lucide-react';
import { CONTACT_EMAIL } from '../lib/contact';
export default function LoginPage() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [notice, setNotice] = useState<string | null>(null);
const handleSubmit = (e: FormEvent) => {
e.preventDefault();
setNotice(
`계약을 희망하시는 경우 ${CONTACT_EMAIL} 로 문의 주세요.`,
);
};
return (
<section className="min-h-screen pt-32 pb-20 px-6 bg-gradient-to-b from-indigo-50/60 via-white to-white">
<div className="max-w-md mx-auto">
{/* 헤드라인 */}
<div className="text-center mb-8">
<Link
to="/"
className="font-serif text-3xl font-black tracking-[0.05em] bg-gradient-to-r from-[#4F1DA1] to-[#021341] bg-clip-text text-transparent"
>
INFINITH
</Link>
<h1 className="text-2xl font-serif font-bold text-primary-900 mt-6 mb-2">
계약 병원 전용 로그인
</h1>
<p className="text-sm text-slate-500 break-keep leading-relaxed">
계약 완료 시 별도 제공되는 자격 정보로 로그인하실 수 있습니다.
</p>
</div>
{/* 준비중 배너 */}
<div className="mb-6 rounded-2xl bg-amber-50/80 border border-amber-200 p-4 text-center">
<p className="text-xs font-semibold text-amber-800 break-keep leading-relaxed">
신규 도입 문의는 하단 "문의하기"를 이용해 주세요.
</p>
</div>
{/* 폼 카드 */}
<form
onSubmit={handleSubmit}
className="rounded-3xl bg-white border border-slate-200 shadow-sm p-8 space-y-5"
>
<div>
<label
htmlFor="login-email"
className="block text-xs font-semibold text-slate-600 mb-2"
>
이메일
</label>
<input
id="login-email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="clinic@example.com"
className="w-full px-4 py-3 text-sm bg-slate-50 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent/40 text-primary-900 placeholder:text-slate-400 transition-all"
autoComplete="email"
/>
</div>
<div>
<label
htmlFor="login-password"
className="block text-xs font-semibold text-slate-600 mb-2"
>
비밀번호
</label>
<input
id="login-password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••"
className="w-full px-4 py-3 text-sm bg-slate-50 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent/40 text-primary-900 placeholder:text-slate-400 transition-all"
autoComplete="current-password"
/>
</div>
<button
type="submit"
className="w-full inline-flex items-center justify-center gap-2 px-6 py-3 text-sm font-bold text-white rounded-full bg-gradient-to-r from-[#4F1DA1] to-[#021341] shadow-sm hover:opacity-90 transition-all"
>
로그인
<ArrowRight className="w-4 h-4" />
</button>
{notice && (
<div
role="status"
className="text-xs text-slate-600 text-center bg-slate-50 rounded-xl p-3 leading-relaxed break-keep"
>
{notice}
</div>
)}
</form>
</div>
</section>
);
}