refactor: remove ProfileForm and update loading state display

- Removed the ProfileForm component from HomePage, simplifying the UI during loading.
- Added a loading spinner and message to indicate redirection to the login page, enhancing user experience.
This commit is contained in:
Julien Froidefond
2025-08-21 12:00:44 +02:00
parent 45fb1148ae
commit e32e3b8bc0
3 changed files with 175 additions and 14 deletions

View File

@@ -2,7 +2,6 @@
import { useEffect, useState } from "react";
import { useEvaluation } from "@/hooks/use-evaluation";
import { ProfileForm } from "@/components/profile-form";
import { SkillsRadarChart } from "@/components/radar-chart";
import {
Card,
@@ -58,8 +57,7 @@ function getScoreColors(score: number) {
}
export default function HomePage() {
const { userEvaluation, skillCategories, teams, loading, updateProfile } =
useEvaluation();
const { userEvaluation, skillCategories, teams, loading } = useEvaluation();
const { setUserInfo } = useUser();
const [expandedCategory, setExpandedCategory] = useState<string | null>(null);
@@ -104,17 +102,13 @@ export default function HomePage() {
<div className="absolute inset-0 bg-grid-white/5 bg-[size:50px_50px]" />
<div className="relative z-10 container mx-auto py-16 px-6">
<div className="text-center mb-12">
<h1 className="text-4xl font-bold mb-4 text-white">
Bienvenue sur PeakSkills
</h1>
<p className="text-lg text-slate-400 mb-8">
Évaluez vos compétences techniques et suivez votre progression
</p>
</div>
<div className="max-w-2xl mx-auto">
<ProfileForm teams={teams} onSubmit={updateProfile} />
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-center">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-400 mx-auto mb-4"></div>
<p className="text-white">
Redirection vers la page de connexion...
</p>
</div>
</div>
</div>
</div>