Feat: auth 관련페이지 header 적용
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
export default function AuthLayout({
|
||||
import { Header } from "@/features/layout/components/header";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
|
||||
export default async function AuthLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const supabase = await createClient();
|
||||
const {
|
||||
data: { user },
|
||||
} = await supabase.auth.getUser();
|
||||
|
||||
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="relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-linear-to-br from-gray-50 via-white to-gray-100 dark:from-black dark:via-gray-950 dark:to-gray-900">
|
||||
{/* ========== 헤더 (홈 이동용) ========== */}
|
||||
<Header user={user} />
|
||||
|
||||
{/* ========== 배경 그라디언트 레이어 ========== */}
|
||||
<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" />
|
||||
@@ -13,8 +24,10 @@ export default function AuthLayout({
|
||||
<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}
|
||||
{/* ========== 메인 콘텐츠 영역 (중앙 정렬) ========== */}
|
||||
<main className="z-10 flex w-full flex-1 flex-col items-center justify-center px-4 py-12">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,7 @@ export default async function ResetPasswordPage({
|
||||
} = await supabase.auth.getUser();
|
||||
|
||||
if (!user) {
|
||||
const message = encodeURIComponent(
|
||||
"유효하지 않은 재설정 링크이거나 만료되었습니다. 다시 시도해 주세요.",
|
||||
);
|
||||
redirect(`/login?message=${message}`);
|
||||
redirect(`/login`);
|
||||
}
|
||||
|
||||
const { message } = params;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
import { UserMenu } from "@/features/layout/components/user-menu";
|
||||
import { Header } from "@/features/layout/components/header";
|
||||
import { AUTH_ROUTES } from "@/features/auth/constants";
|
||||
import { SplineScene } from "@/features/home/components/spline-scene";
|
||||
|
||||
export default async function HomePage() {
|
||||
const supabase = await createClient();
|
||||
@@ -12,67 +13,53 @@ export default async function HomePage() {
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<header className="sticky top-0 z-40 flex h-14 w-full items-center justify-between border-b border-zinc-200 bg-white/75 px-6 backdrop-blur-md dark:border-zinc-800 dark:bg-black/75">
|
||||
<Link href={AUTH_ROUTES.HOME} className="flex items-center gap-2">
|
||||
<div className="h-6 w-6 rounded-md bg-zinc-900 dark:bg-zinc-50" />
|
||||
<span className="text-lg font-bold tracking-tight text-zinc-900 dark:text-zinc-50">
|
||||
AutoTrade
|
||||
</span>
|
||||
</Link>
|
||||
<div className="flex items-center gap-4">
|
||||
{user ? (
|
||||
<>
|
||||
<Button asChild variant="ghost" size="sm">
|
||||
<Link href={AUTH_ROUTES.DASHBOARD}>대시보드</Link>
|
||||
</Button>
|
||||
<UserMenu user={user} />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Button asChild variant="ghost" size="sm">
|
||||
<Link href={AUTH_ROUTES.LOGIN}>로그인</Link>
|
||||
</Button>
|
||||
<Button asChild size="sm">
|
||||
<Link href={AUTH_ROUTES.SIGNUP}>무료로 시작하기</Link>
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
<Header user={user} showDashboardLink={true} />
|
||||
|
||||
<main className="flex-1">
|
||||
<section className="space-y-6 pb-8 pt-6 md:pb-12 md:pt-10 lg:py-32">
|
||||
<div className="container flex max-w-5xl flex-col items-center gap-4 text-center">
|
||||
<h1 className="font-heading text-3xl sm:text-5xl md:text-6xl lg:text-7xl">
|
||||
투자의 미래,{" "}
|
||||
<span className="text-gradient bg-linear-to-r from-indigo-500 to-purple-600 bg-clip-text text-transparent">
|
||||
자동화하세요
|
||||
</span>
|
||||
</h1>
|
||||
<p className="max-w-2xl leading-normal text-muted-foreground sm:text-xl sm:leading-8">
|
||||
AutoTrade는 최첨단 알고리즘을 통해 당신의 암호화폐 투자를 24시간
|
||||
관리합니다. 감정에 휘둘리지 않는 투자를 경험하세요.
|
||||
</p>
|
||||
<div className="space-x-4">
|
||||
{user ? (
|
||||
<Button asChild size="lg" className="h-11 px-8">
|
||||
<Link href={AUTH_ROUTES.DASHBOARD}>대시보드로 이동</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button asChild size="lg" className="h-11 px-8">
|
||||
<Link href={AUTH_ROUTES.LOGIN}>지금 시작하기</Link>
|
||||
</Button>
|
||||
)}
|
||||
{!user && (
|
||||
<Button
|
||||
asChild
|
||||
variant="outline"
|
||||
size="lg"
|
||||
className="h-11 px-8"
|
||||
>
|
||||
<Link href={AUTH_ROUTES.LOGIN}>데모 체험</Link>
|
||||
</Button>
|
||||
)}
|
||||
<section className="relative overflow-hidden pb-8 pt-6 md:pb-12 md:pt-10 lg:py-32">
|
||||
<div className="container relative z-10 flex max-w-7xl flex-col items-center gap-4 lg:grid lg:grid-cols-2 lg:gap-8 lg:text-left">
|
||||
<div className="flex flex-col items-center lg:items-start lg:gap-8">
|
||||
<h1 className="font-heading text-3xl sm:text-5xl md:text-6xl lg:text-7xl">
|
||||
투자의 미래,{" "}
|
||||
<span className="text-gradient bg-linear-to-r from-indigo-500 to-purple-600 bg-clip-text text-transparent">
|
||||
자동화하세요
|
||||
</span>
|
||||
</h1>
|
||||
<p className="max-w-2xl leading-normal text-muted-foreground sm:text-xl sm:leading-8">
|
||||
AutoTrade는 최첨단 알고리즘을 통해 당신의 암호화폐 투자를 24시간
|
||||
관리합니다. 감정에 휘둘리지 않는 투자를 경험하세요.
|
||||
</p>
|
||||
<div className="space-x-4">
|
||||
{user ? (
|
||||
<Button asChild size="lg" className="h-11 px-8">
|
||||
<Link href={AUTH_ROUTES.DASHBOARD}>대시보드로 이동</Link>
|
||||
</Button>
|
||||
) : (
|
||||
<Button asChild size="lg" className="h-11 px-8">
|
||||
<Link href={AUTH_ROUTES.LOGIN}>지금 시작하기</Link>
|
||||
</Button>
|
||||
)}
|
||||
{!user && (
|
||||
<Button
|
||||
asChild
|
||||
variant="outline"
|
||||
size="lg"
|
||||
className="h-11 px-8"
|
||||
>
|
||||
<Link href={AUTH_ROUTES.LOGIN}>데모 체험</Link>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="relative mt-8 h-[400px] w-full lg:mt-0 lg:h-[600px]">
|
||||
{/* Spline Scene Container */}
|
||||
<div className="absolute inset-0 rounded-2xl bg-zinc-100/50 dark:bg-zinc-900/50">
|
||||
<SplineScene
|
||||
sceneUrl="https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode"
|
||||
className="rounded-2xl"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import { Header } from "@/features/layout/components/header";
|
||||
import { Sidebar } from "@/features/layout/components/sidebar";
|
||||
import { createClient } from "@/utils/supabase/server";
|
||||
|
||||
export default function MainLayout({
|
||||
export default async function MainLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const supabase = await createClient();
|
||||
const {
|
||||
data: { user },
|
||||
} = await supabase.auth.getUser();
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col bg-zinc-50 dark:bg-black">
|
||||
<Header />
|
||||
<Header user={user} />
|
||||
<div className="flex flex-1">
|
||||
<Sidebar />
|
||||
<main className="flex-1 w-full p-6 md:p-8 lg:p-10">{children}</main>
|
||||
|
||||
Reference in New Issue
Block a user