Feat: 대시보드 추가
app/(auth)/forgot-password/page.tsx - 비밀번호 초기화 페이지 레이아웃 정리 및 카드 스타일 개선 app/(auth)/login/page.tsx - 로그인 페이지 레이아웃 경량화 및 메시지 표시 유지 app/(auth)/reset-password/page.tsx - 리셋 비밀번호 페이지 레이아웃 정리 app/(auth)/signup/page.tsx - 회원가입 페이지 레이아웃 정리 및 링크 배치 개선 app/(auth)/layout.tsx - 인증 관련 공통 배경 레이아웃 추가 (그라디언트/블러 효과 분리) app/(main)/layout.tsx - 메인 레이아웃 추가 (헤더, 사이드바 포함) app/(main)/page.tsx - 대시보드 기본 페이지 추가 (위젯/플레이스홀더) app/page.tsx - 기존 메인 페이지 제거 (대시보드로 대체) components/ui/avatar.tsx - 아바타 UI 컴포넌트 추가 components/ui/dropdown-menu.tsx - 드롭다운 메뉴 UI 컴포넌트 추가 (Radix 기반) features/layout/components/header.tsx - 헤더 컴포넌트 추가 (사용자 상태 표시 및 메뉴 연결) features/layout/components/sidebar.tsx - 사이드바 네비게이션 컴포넌트 추가 features/layout/components/user-menu.tsx - 사용자 드롭다운 메뉴 추가 (로그아웃 등) features/layout/types/index.ts - 레이아웃 관련 타입 정의 추가 package.json - Radix 드롭다운, Framer Motion 등 UI 관련 의존성 추가 package-lock.json - 패키지 잠금파일 갱신 및 교체 - 인증 및 메인 영역 구조를 분리하고 공통 레이아웃과 재사용 가능한 UI 컴포넌트를 도입하여 향후 페이지 확장 및 유지보수성을 개선합니다
This commit is contained in:
85
app/(auth)/forgot-password/page.tsx
Normal file
85
app/(auth)/forgot-password/page.tsx
Normal file
@@ -0,0 +1,85 @@
|
||||
import FormMessage from "@/components/form-message";
|
||||
import { requestPasswordReset } from "@/features/auth/actions";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import Link from "next/link";
|
||||
|
||||
/**
|
||||
* [비밀번호 찾기 페이지]
|
||||
*
|
||||
* 사용자가 비밀번호를 잊어버렸을 때 재설정 링크를 요청하는 페이지입니다.
|
||||
* - 이메일 입력 폼 제공
|
||||
* - 서버 액션(requestPasswordReset)과 연동
|
||||
*/
|
||||
export default async function ForgotPasswordPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ message?: string }>;
|
||||
}) {
|
||||
const { message } = await searchParams;
|
||||
|
||||
return (
|
||||
<div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
|
||||
{message && <FormMessage message={message} />}
|
||||
|
||||
<Card className="border-white/20 bg-white/70 shadow-2xl backdrop-blur-xl dark:border-white/10 dark:bg-gray-900/70">
|
||||
<CardHeader className="space-y-3 text-center">
|
||||
<div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-gray-800 to-black shadow-lg dark:from-white dark:to-gray-200">
|
||||
<span className="text-sm font-semibold">MAIL</span>
|
||||
</div>
|
||||
<CardTitle className="text-3xl font-bold tracking-tight">
|
||||
비밀번호 재설정
|
||||
</CardTitle>
|
||||
<CardDescription className="text-base">
|
||||
가입한 이메일 주소를 입력하시면 비밀번호 재설정 링크를 보내드립니다.
|
||||
<br />
|
||||
메일을 받지 못하셨다면 스팸함을 확인해 주세요.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="space-y-6">
|
||||
<form className="space-y-5">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="email" className="text-sm font-medium">
|
||||
이메일
|
||||
</Label>
|
||||
<Input
|
||||
id="email"
|
||||
name="email"
|
||||
type="email"
|
||||
placeholder="name@example.com"
|
||||
autoComplete="email"
|
||||
required
|
||||
className="h-11 transition-all duration-200"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
formAction={requestPasswordReset}
|
||||
className="h-11 w-full bg-linear-to-r from-gray-900 to-black font-semibold text-white shadow-lg transition-all 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"
|
||||
>
|
||||
재설정 링크 보내기
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div className="text-center">
|
||||
<Link
|
||||
href="/login"
|
||||
className="text-sm font-medium text-gray-700 hover:text-black dark:text-gray-300 dark:hover:text-white"
|
||||
>
|
||||
로그인 페이지로 돌아가기
|
||||
</Link>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
20
app/(auth)/layout.tsx
Normal file
20
app/(auth)/layout.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
export default function AuthLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<div className="relative flex min-h-screen items-center justify-center overflow-hidden bg-linear-to-br from-gray-50 via-white to-gray-100 px-4 py-12 dark:from-black dark:via-gray-950 dark:to-gray-900">
|
||||
{/* ========== 배경 그라디언트 레이어 ========== */}
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,var(--tw-gradient-stops))] from-gray-200/30 via-gray-100/15 to-transparent dark:from-gray-800/30 dark:via-gray-900/20" />
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_left,var(--tw-gradient-stops))] from-gray-300/30 via-gray-200/15 to-transparent dark:from-gray-700/30 dark:via-gray-800/20" />
|
||||
|
||||
{/* ========== 애니메이션 블러 효과 ========== */}
|
||||
<div className="absolute left-1/4 top-1/4 h-64 w-64 animate-pulse rounded-full bg-gray-300/20 blur-3xl dark:bg-gray-700/20" />
|
||||
<div className="absolute bottom-1/4 right-1/4 h-64 w-64 animate-pulse rounded-full bg-gray-400/20 blur-3xl delay-700 dark:bg-gray-600/20" />
|
||||
|
||||
{/* ========== 메인 콘텐츠 영역 ========== */}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
62
app/(auth)/login/page.tsx
Normal file
62
app/(auth)/login/page.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import FormMessage from "@/components/form-message";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import LoginForm from "@/features/auth/components/login-form";
|
||||
|
||||
/**
|
||||
* [로그인 페이지 컴포넌트]
|
||||
*
|
||||
* Modern UI with glassmorphism effect (유리 형태 디자인)
|
||||
* - 투명 배경 + 블러 효과로 깊이감 표현
|
||||
* - 그라디언트 배경으로 생동감 추가
|
||||
* - shadcn/ui 컴포넌트로 일관된 디자인 시스템 유지
|
||||
*
|
||||
* @param searchParams - URL 쿼리 파라미터 (에러 메시지 전달용)
|
||||
*/
|
||||
export default async function LoginPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ message: string }>;
|
||||
}) {
|
||||
// URL에서 메시지 파라미터 추출 (로그인 실패 시 에러 메시지 표시)
|
||||
const { message } = await searchParams;
|
||||
|
||||
return (
|
||||
<div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
|
||||
{/* 에러/성공 메시지 표시 영역 */}
|
||||
{/* URL 파라미터에 message가 있으면 표시됨 */}
|
||||
<FormMessage message={message} />
|
||||
|
||||
{/* ========== 로그인 카드 (Glassmorphism) ========== */}
|
||||
{/* bg-white/70: 70% 투명도의 흰색 배경 */}
|
||||
{/* backdrop-blur-xl: 배경 블러 효과 (유리 느낌) */}
|
||||
<Card className="border-white/20 bg-white/70 shadow-2xl backdrop-blur-xl dark:border-white/10 dark:bg-gray-900/70">
|
||||
{/* ========== 카드 헤더 영역 ========== */}
|
||||
<CardHeader className="space-y-3 text-center">
|
||||
{/* 아이콘 배경: 그라디언트 원형 */}
|
||||
<div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-gray-800 to-black shadow-lg dark:from-white dark:to-gray-200">
|
||||
<span className="text-4xl">👋</span>
|
||||
</div>
|
||||
{/* 페이지 제목 */}
|
||||
<CardTitle className="text-3xl font-bold tracking-tight">
|
||||
환영합니다!
|
||||
</CardTitle>
|
||||
{/* 페이지 설명 */}
|
||||
<CardDescription className="text-base">
|
||||
서비스 이용을 위해 로그인해 주세요.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
{/* ========== 카드 콘텐츠 영역 (폼) ========== */}
|
||||
<CardContent>
|
||||
<LoginForm />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
64
app/(auth)/reset-password/page.tsx
Normal file
64
app/(auth)/reset-password/page.tsx
Normal file
@@ -0,0 +1,64 @@
|
||||
import FormMessage from "@/components/form-message";
|
||||
import ResetPasswordForm from "@/features/auth/components/reset-password-form";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/**
|
||||
* [비밀번호 재설정 페이지]
|
||||
*
|
||||
* 이메일 링크를 타고 들어온 사용자가 새 비밀번호를 설정하는 페이지입니다.
|
||||
* - URL에 포함된 토큰 검증은 Middleware 및 Auth Confirm Route에서 선행됩니다.
|
||||
* - 유효한 세션(Recovery Mode)이 없으면 로그인 페이지로 리다이렉트됩니다.
|
||||
*/
|
||||
export default async function ResetPasswordPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ message?: string }>;
|
||||
}) {
|
||||
const params = await searchParams;
|
||||
const supabase = await createClient();
|
||||
|
||||
const {
|
||||
data: { user },
|
||||
} = await supabase.auth.getUser();
|
||||
|
||||
if (!user) {
|
||||
const message = encodeURIComponent(
|
||||
"유효하지 않은 재설정 링크이거나 만료되었습니다. 다시 시도해 주세요.",
|
||||
);
|
||||
redirect(`/login?message=${message}`);
|
||||
}
|
||||
|
||||
const { message } = params;
|
||||
|
||||
return (
|
||||
<div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
|
||||
{message && <FormMessage message={message} />}
|
||||
|
||||
<Card className="border-white/20 bg-white/70 shadow-2xl backdrop-blur-xl dark:border-white/10 dark:bg-gray-900/70">
|
||||
<CardHeader className="space-y-3 text-center">
|
||||
<div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-gray-800 to-black shadow-lg dark:from-white dark:to-gray-200">
|
||||
<span className="text-sm font-semibold">PW</span>
|
||||
</div>
|
||||
<CardTitle className="text-3xl font-bold tracking-tight">
|
||||
비밀번호 재설정
|
||||
</CardTitle>
|
||||
<CardDescription className="text-base">
|
||||
새 비밀번호를 입력해 주세요.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="space-y-6">
|
||||
<ResetPasswordForm />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
55
app/(auth)/signup/page.tsx
Normal file
55
app/(auth)/signup/page.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import Link from "next/link";
|
||||
import FormMessage from "@/components/form-message";
|
||||
import SignupForm from "@/features/auth/components/signup-form";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
|
||||
export default async function SignupPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ message: string }>;
|
||||
}) {
|
||||
const { message } = await searchParams;
|
||||
|
||||
return (
|
||||
<div className="relative z-10 w-full max-w-md animate-in fade-in slide-in-from-bottom-4 duration-700">
|
||||
{/* 메시지 알림 */}
|
||||
<FormMessage message={message} />
|
||||
|
||||
<Card className="border-white/20 bg-white/70 shadow-2xl backdrop-blur-xl dark:border-white/10 dark:bg-gray-900/70">
|
||||
<CardHeader className="space-y-3 text-center">
|
||||
<div className="mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-2xl bg-linear-to-br from-gray-800 to-black shadow-lg dark:from-white dark:to-gray-200">
|
||||
<span className="text-4xl">🚀</span>
|
||||
</div>
|
||||
<CardTitle className="text-3xl font-bold tracking-tight">
|
||||
회원가입
|
||||
</CardTitle>
|
||||
<CardDescription className="text-base">
|
||||
몇 가지 정보만 입력하면 바로 시작할 수 있습니다.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
{/* ========== 폼 영역 ========== */}
|
||||
<CardContent className="space-y-6">
|
||||
<SignupForm />
|
||||
|
||||
{/* ========== 로그인 링크 ========== */}
|
||||
<p className="text-center text-sm text-gray-600 dark:text-gray-400">
|
||||
이미 계정이 있으신가요?{" "}
|
||||
<Link
|
||||
href="/login"
|
||||
className="font-semibold text-gray-900 transition-colors hover:text-black dark:text-gray-100 dark:hover:text-white"
|
||||
>
|
||||
로그인 하러 가기
|
||||
</Link>
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user