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 { Button } from "@/components/ui/button";
|
||||||
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { useEffect, useState } from 'react';
|
import { ThemeToggle } from "@/components/ui/theme-toggle";
|
||||||
import { useRouter } from 'next/navigation';
|
import { Home, Settings, User } from "lucide-react";
|
||||||
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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export default function TestPage() {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen">
|
<div className="min-h-screen p-8 bg-background text-foreground">
|
||||||
<Sidebar />
|
<div className="max-w-4xl mx-auto space-y-8">
|
||||||
<div className="flex-1">
|
<div className="flex justify-between items-center">
|
||||||
<Header username={user?.username} />
|
<h1 className="text-3xl font-bold">Phase 1 테스트</h1>
|
||||||
<main className="p-6">
|
<ThemeToggle />
|
||||||
<h1 className="text-2xl font-bold text-gray-800 mb-6">대시보드</h1>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
<Card>
|
||||||
<div className="bg-white rounded-lg shadow p-6">
|
<CardHeader>
|
||||||
<h3 className="text-gray-500 text-sm mb-1">총 자산</h3>
|
<CardTitle>shadcn/ui 컴포넌트 테스트</CardTitle>
|
||||||
<p className="text-2xl font-bold text-gray-800">₩0</p>
|
</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>
|
||||||
<div className="bg-white rounded-lg shadow p-6">
|
<div className="flex gap-4 items-center">
|
||||||
<h3 className="text-gray-500 text-sm mb-1">총 수익률</h3>
|
<Home className="h-6 w-6" />
|
||||||
<p className="text-2xl font-bold text-green-600">+0.00%</p>
|
<Settings className="h-6 w-6" />
|
||||||
|
<User className="h-6 w-6" />
|
||||||
|
<span>Lucide Icons</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="bg-white rounded-lg shadow p-6">
|
</CardContent>
|
||||||
<h3 className="text-gray-500 text-sm mb-1">포트폴리오</h3>
|
</Card>
|
||||||
<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>
|
|
||||||
|
|
||||||
<div className="bg-white rounded-lg shadow p-6">
|
<Card>
|
||||||
<h2 className="text-lg font-semibold text-gray-800 mb-4">최근 활동</h2>
|
<CardHeader>
|
||||||
<p className="text-gray-500">아직 활동 내역이 없습니다.</p>
|
<CardTitle>테마 테스트</CardTitle>
|
||||||
</div>
|
</CardHeader>
|
||||||
</main>
|
<CardContent>
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
위의 테마 토글 버튼으로 라이트/다크 모드를 전환해보세요.
|
||||||
|
</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user