test(frontend): add Phase 1 test page
- Verify shadcn/ui components render correctly - Verify theme toggle works - Verify Lucide icons display - Temporary page for Phase 1 verification Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4178744afe
commit
0200ebc7ad
@ -1,77 +1,48 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import Sidebar from '@/components/layout/Sidebar';
|
||||
import Header from '@/components/layout/Header';
|
||||
import { api } from '@/lib/api';
|
||||
|
||||
interface User {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export default function Dashboard() {
|
||||
const router = useRouter();
|
||||
const [user, setUser] = useState<User | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const checkAuth = async () => {
|
||||
try {
|
||||
const userData = await api.getCurrentUser() as User;
|
||||
setUser(userData);
|
||||
} catch {
|
||||
router.push('/login');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
checkAuth();
|
||||
}, [router]);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center">
|
||||
<div className="text-gray-500">Loading...</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { ThemeToggle } from "@/components/ui/theme-toggle";
|
||||
import { Home, Settings, User } from "lucide-react";
|
||||
|
||||
export default function TestPage() {
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<div className="flex-1">
|
||||
<Header username={user?.username} />
|
||||
<main className="p-6">
|
||||
<h1 className="text-2xl font-bold text-gray-800 mb-6">대시보드</h1>
|
||||
<div className="min-h-screen p-8 bg-background text-foreground">
|
||||
<div className="max-w-4xl mx-auto space-y-8">
|
||||
<div className="flex justify-between items-center">
|
||||
<h1 className="text-3xl font-bold">Phase 1 테스트</h1>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||
<div className="bg-white rounded-lg shadow p-6">
|
||||
<h3 className="text-gray-500 text-sm mb-1">총 자산</h3>
|
||||
<p className="text-2xl font-bold text-gray-800">₩0</p>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>shadcn/ui 컴포넌트 테스트</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="flex gap-2">
|
||||
<Button>Primary</Button>
|
||||
<Button variant="secondary">Secondary</Button>
|
||||
<Button variant="destructive">Destructive</Button>
|
||||
<Button variant="outline">Outline</Button>
|
||||
<Button variant="ghost">Ghost</Button>
|
||||
</div>
|
||||
<div className="bg-white rounded-lg shadow p-6">
|
||||
<h3 className="text-gray-500 text-sm mb-1">총 수익률</h3>
|
||||
<p className="text-2xl font-bold text-green-600">+0.00%</p>
|
||||
<div className="flex gap-4 items-center">
|
||||
<Home className="h-6 w-6" />
|
||||
<Settings className="h-6 w-6" />
|
||||
<User className="h-6 w-6" />
|
||||
<span>Lucide Icons</span>
|
||||
</div>
|
||||
<div className="bg-white rounded-lg shadow p-6">
|
||||
<h3 className="text-gray-500 text-sm mb-1">포트폴리오</h3>
|
||||
<p className="text-2xl font-bold text-gray-800">0개</p>
|
||||
</div>
|
||||
<div className="bg-white rounded-lg shadow p-6">
|
||||
<h3 className="text-gray-500 text-sm mb-1">리밸런싱 필요</h3>
|
||||
<p className="text-2xl font-bold text-orange-600">0건</p>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<div className="bg-white rounded-lg shadow p-6">
|
||||
<h2 className="text-lg font-semibold text-gray-800 mb-4">최근 활동</h2>
|
||||
<p className="text-gray-500">아직 활동 내역이 없습니다.</p>
|
||||
</div>
|
||||
</main>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>테마 테스트</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-muted-foreground">
|
||||
위의 테마 토글 버튼으로 라이트/다크 모드를 전환해보세요.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user