ProjectMemory / frontend /src /pages /DashboardPage.tsx
Amal Nimmy Lal
feat : Project Memory
35765b5
import { useUser } from '../context/UserContext';
import { useProject } from '../context/ProjectContext';
export function DashboardPage() {
const { user, logout } = useUser();
const { currentProject, clearProject } = useProject();
if (!user || !currentProject) return null;
const handleLogout = () => {
clearProject();
logout();
};
return (
<div className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
{/* Header */}
<header className="bg-white/5 backdrop-blur-lg border-b border-white/10">
<div className="max-w-4xl mx-auto px-4 py-4 flex items-center justify-between">
<div className="flex items-center gap-3">
<h1 className="text-xl font-bold text-white">Project Memory</h1>
<span className="text-purple-300/50">|</span>
<span className="text-purple-300">{currentProject.name}</span>
</div>
<div className="flex items-center gap-4">
<span className="text-purple-300 text-sm">{user.firstName} ({user.id})</span>
<button
onClick={handleLogout}
className="px-3 py-1.5 bg-white/10 hover:bg-white/20 text-white rounded-lg transition-all text-sm"
>
Logout
</button>
</div>
</div>
</header>
{/* Main Content */}
<main className="max-w-4xl mx-auto px-4 py-12">
<div className="bg-white/10 backdrop-blur-lg rounded-2xl p-8 border border-white/20 text-center">
<div className="mb-6">
<h2 className="text-3xl font-bold text-white mb-2">{currentProject.name}</h2>
{currentProject.description && (
<p className="text-purple-300">{currentProject.description}</p>
)}
</div>
<div className="inline-block px-3 py-1 bg-purple-500/20 text-purple-300 rounded-full text-sm mb-8">
Role: {currentProject.role || 'member'}
</div>
{/* Placeholder */}
<div className="bg-white/5 rounded-xl p-12 border border-white/10">
<div className="text-6xl mb-4">🚧</div>
<h3 className="text-xl font-semibold text-white mb-2">Coming Soon</h3>
<p className="text-purple-300/70 max-w-md mx-auto">
Task management, activity feed, and smart search features are being built. Stay tuned!
</p>
</div>
{/* Project Info */}
<div className="mt-8 text-sm text-purple-300/50">
Project ID: <code className="bg-white/10 px-2 py-0.5 rounded">{currentProject.id}</code>
<span className="mx-2"></span>
Share this ID with teammates to let them join
</div>
</div>
</main>
</div>
);
}