feat: refactor workshop management by centralizing workshop data and improving session navigation across components
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m0s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m0s
This commit is contained in:
@@ -6,6 +6,7 @@ import { useSession, signOut } from 'next-auth/react';
|
||||
import { useTheme } from '@/contexts/ThemeContext';
|
||||
import { useState } from 'react';
|
||||
import { Avatar, RocketIcon } from '@/components/ui';
|
||||
import { WORKSHOPS } from '@/lib/workshops';
|
||||
|
||||
export function Header() {
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
@@ -65,11 +66,7 @@ export function Header() {
|
||||
onClick={() => setWorkshopsOpen(!workshopsOpen)}
|
||||
onBlur={() => setTimeout(() => setWorkshopsOpen(false), 150)}
|
||||
className={`flex items-center gap-1 text-sm font-medium transition-colors ${
|
||||
isActiveLink('/sessions/') ||
|
||||
isActiveLink('/motivators') ||
|
||||
isActiveLink('/year-review') ||
|
||||
isActiveLink('/weekly-checkin') ||
|
||||
isActiveLink('/weather')
|
||||
WORKSHOPS.some((w) => isActiveLink(w.path))
|
||||
? 'text-primary'
|
||||
: 'text-muted hover:text-foreground'
|
||||
}`}
|
||||
@@ -92,61 +89,20 @@ export function Header() {
|
||||
|
||||
{workshopsOpen && (
|
||||
<div className="absolute left-0 z-20 mt-2 w-56 rounded-lg border border-border bg-card py-1 shadow-lg">
|
||||
<Link
|
||||
href="/sessions/new"
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">📊</span>
|
||||
<div>
|
||||
<div className="font-medium">Analyse SWOT</div>
|
||||
<div className="text-xs text-muted">Forces, faiblesses, opportunités</div>
|
||||
</div>
|
||||
</Link>
|
||||
<Link
|
||||
href="/motivators/new"
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">🎯</span>
|
||||
<div>
|
||||
<div className="font-medium">Moving Motivators</div>
|
||||
<div className="text-xs text-muted">Motivations intrinsèques</div>
|
||||
</div>
|
||||
</Link>
|
||||
<Link
|
||||
href="/year-review/new"
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">📅</span>
|
||||
<div>
|
||||
<div className="font-medium">Year Review</div>
|
||||
<div className="text-xs text-muted">Bilan de l'année</div>
|
||||
</div>
|
||||
</Link>
|
||||
<Link
|
||||
href="/weekly-checkin/new"
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">📝</span>
|
||||
<div>
|
||||
<div className="font-medium">Weekly Check-in</div>
|
||||
<div className="text-xs text-muted">Suivi hebdomadaire</div>
|
||||
</div>
|
||||
</Link>
|
||||
<Link
|
||||
href="/weather/new"
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">🌤️</span>
|
||||
<div>
|
||||
<div className="font-medium">Météo d'équipe</div>
|
||||
<div className="text-xs text-muted">Humeur et énergie</div>
|
||||
</div>
|
||||
</Link>
|
||||
{WORKSHOPS.map((w) => (
|
||||
<Link
|
||||
key={w.id}
|
||||
href={w.newPath}
|
||||
className="flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-card-hover"
|
||||
onClick={() => setWorkshopsOpen(false)}
|
||||
>
|
||||
<span className="text-lg">{w.icon}</span>
|
||||
<div>
|
||||
<div className="font-medium">{w.label}</div>
|
||||
<div className="text-xs text-muted">{w.description}</div>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user