테마 적용
This commit is contained in:
@@ -26,7 +26,6 @@ import { InlineSpinner } from "@/components/ui/loading-spinner";
|
||||
*/
|
||||
export default function LoginForm() {
|
||||
// ========== 상태 관리 ==========
|
||||
// 서버와 클라이언트 초기 렌더링을 일치시키기 위해 초기값은 고정
|
||||
const [email, setEmail] = useState(() => {
|
||||
if (typeof window === "undefined") return "";
|
||||
return localStorage.getItem("auto-trade-saved-email") || "";
|
||||
@@ -37,11 +36,6 @@ export default function LoginForm() {
|
||||
});
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
// ========== 마운트 시 localStorage 데이터 복구 ==========
|
||||
// localStorage는 클라이언트 전용 외부 시스템이므로 useEffect에서 동기화하는 것이 올바른 패턴
|
||||
// React 공식 문서: "외부 시스템과 동기화"는 useEffect의 정확한 사용 사례
|
||||
// useState lazy initializer + window guard handles localStorage safely
|
||||
|
||||
// ========== 폼 제출 핸들러 ==========
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
@@ -83,7 +77,7 @@ export default function LoginForm() {
|
||||
required
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
className="h-11 transition-all duration-200"
|
||||
className="h-11 transition-all duration-200 focus-visible:ring-brand-500"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -102,7 +96,7 @@ export default function LoginForm() {
|
||||
minLength={8}
|
||||
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*]).{8,}$"
|
||||
title="비밀번호는 최소 8자 이상, 대문자, 소문자, 숫자, 특수문자를 각각 1개 이상 포함해야 합니다."
|
||||
className="h-11 transition-all duration-200"
|
||||
className="h-11 transition-all duration-200 focus-visible:ring-brand-500"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -121,10 +115,9 @@ export default function LoginForm() {
|
||||
이메일 기억하기
|
||||
</Label>
|
||||
</div>
|
||||
{/* 비밀번호 찾기 링크 */}
|
||||
<Link
|
||||
href={AUTH_ROUTES.FORGOT_PASSWORD}
|
||||
className="text-sm font-medium text-gray-700 hover:text-black dark:text-gray-300 dark:hover:text-white"
|
||||
className="text-sm font-medium text-brand-600 transition-colors hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300"
|
||||
>
|
||||
비밀번호 찾기
|
||||
</Link>
|
||||
@@ -134,7 +127,7 @@ export default function LoginForm() {
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={isLoading}
|
||||
className="h-11 w-full bg-linear-to-r from-gray-900 to-black font-semibold shadow-lg transition-all duration-200 hover:from-black hover:to-gray-800 hover:shadow-xl dark:from-white dark:to-gray-100 dark:text-black dark:hover:from-gray-100 dark:hover:to-white"
|
||||
className="h-11 w-full bg-linear-to-r from-brand-500 to-brand-700 font-semibold text-white shadow-lg shadow-brand-500/20 transition-all duration-200 hover:from-brand-600 hover:to-brand-800 hover:shadow-xl hover:shadow-brand-500/25"
|
||||
size="lg"
|
||||
>
|
||||
{isLoading ? (
|
||||
@@ -148,11 +141,11 @@ export default function LoginForm() {
|
||||
</Button>
|
||||
|
||||
{/* ========== 회원가입 링크 ========== */}
|
||||
<p className="text-center text-sm text-gray-600 dark:text-gray-400">
|
||||
<p className="text-center text-sm text-muted-foreground">
|
||||
계정이 없으신가요?{" "}
|
||||
<Link
|
||||
href={AUTH_ROUTES.SIGNUP}
|
||||
className="font-semibold text-gray-900 transition-colors hover:text-black dark:text-gray-100 dark:hover:text-white"
|
||||
className="font-semibold text-brand-600 transition-colors hover:text-brand-700 dark:text-brand-400 dark:hover:text-brand-300"
|
||||
>
|
||||
회원가입 하기
|
||||
</Link>
|
||||
@@ -162,7 +155,7 @@ export default function LoginForm() {
|
||||
{/* ========== 소셜 로그인 구분선 ========== */}
|
||||
<div className="relative">
|
||||
<Separator className="my-6" />
|
||||
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white px-3 text-xs font-medium text-gray-500 dark:bg-gray-900 dark:text-gray-400">
|
||||
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white px-3 text-xs font-medium text-muted-foreground dark:bg-brand-950">
|
||||
또는 소셜 로그인
|
||||
</span>
|
||||
</div>
|
||||
@@ -174,7 +167,7 @@ export default function LoginForm() {
|
||||
<Button
|
||||
type="submit"
|
||||
variant="outline"
|
||||
className="h-11 w-full border-gray-200 bg-white shadow-sm transition-all duration-200 hover:bg-gray-50 hover:shadow-md dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-750"
|
||||
className="h-11 w-full border-brand-200/50 bg-white shadow-sm transition-all duration-200 hover:bg-brand-50 hover:shadow-md dark:border-brand-800/50 dark:bg-brand-950/50 dark:hover:bg-brand-900/50"
|
||||
>
|
||||
<svg className="mr-2 h-5 w-5" viewBox="0 0 24 24">
|
||||
<path
|
||||
|
||||
Reference in New Issue
Block a user