feat: add user preferences for filter and objective visibility in HomePageClient
- Implemented state management for filter and objective visibility using `useState`. - Integrated `userPreferencesService` to load and save user preferences on component mount and toggle actions. - Updated `KanbanBoardContainer` to conditionally render filters and objectives based on user preferences. - Enhanced UI with buttons for toggling visibility, improving user experience and customization.
This commit is contained in:
@@ -10,6 +10,7 @@ import { Card } from '@/components/ui/Card';
|
||||
import Link from 'next/link';
|
||||
import { DailyCalendar } from '@/components/daily/DailyCalendar';
|
||||
import { dailyClient } from '@/clients/daily-client';
|
||||
import { SimpleHeader } from '@/components/ui/SimpleHeader';
|
||||
|
||||
interface DailySectionProps {
|
||||
title: string;
|
||||
@@ -367,58 +368,51 @@ export function DailyPageClient({
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[var(--background)]">
|
||||
{/* Header */}
|
||||
<header className="bg-[var(--card)]/80 backdrop-blur-sm border-b border-[var(--border)]/50 sticky top-0 z-10">
|
||||
<div className="container mx-auto px-4 py-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-4">
|
||||
<Link
|
||||
href="/"
|
||||
className="text-[var(--primary)] hover:text-[var(--primary)]/80 font-mono text-sm"
|
||||
>
|
||||
← Kanban
|
||||
</Link>
|
||||
<h1 className="text-xl font-bold text-[var(--foreground)] font-mono">
|
||||
📝 Daily
|
||||
</h1>
|
||||
</div>
|
||||
{/* Header uniforme */}
|
||||
<SimpleHeader
|
||||
title="TowerControl"
|
||||
subtitle="Daily - Gestion quotidienne"
|
||||
syncing={saving}
|
||||
/>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
onClick={goToPreviousDay}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={saving}
|
||||
>
|
||||
←
|
||||
</Button>
|
||||
|
||||
<div className="text-center min-w-[200px]">
|
||||
<div className="text-sm font-bold text-[var(--foreground)] font-mono">
|
||||
{formatCurrentDate()}
|
||||
</div>
|
||||
{!isToday() && (
|
||||
<button
|
||||
onClick={goToToday}
|
||||
className="text-xs text-[var(--primary)] hover:text-[var(--primary)]/80 font-mono"
|
||||
>
|
||||
Aller à aujourd'hui
|
||||
</button>
|
||||
)}
|
||||
{/* Navigation Daily spécifique */}
|
||||
<div className="bg-[var(--card)]/50 border-b border-[var(--border)]/30">
|
||||
<div className="container mx-auto px-4 py-3">
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<Button
|
||||
onClick={goToPreviousDay}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={saving}
|
||||
>
|
||||
←
|
||||
</Button>
|
||||
|
||||
<div className="text-center min-w-[200px]">
|
||||
<div className="text-sm font-bold text-[var(--foreground)] font-mono">
|
||||
{formatCurrentDate()}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
onClick={goToNextDay}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={saving}
|
||||
>
|
||||
→
|
||||
</Button>
|
||||
{!isToday() && (
|
||||
<button
|
||||
onClick={goToToday}
|
||||
className="text-xs text-[var(--primary)] hover:text-[var(--primary)]/80 font-mono"
|
||||
>
|
||||
Aller à aujourd'hui
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
onClick={goToNextDay}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
disabled={saving}
|
||||
>
|
||||
→
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
{/* Contenu principal */}
|
||||
<main className="container mx-auto px-4 py-8">
|
||||
|
||||
@@ -8,7 +8,7 @@ import { CreateTagData } from '@/clients/tags-client';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Input } from '@/components/ui/Input';
|
||||
import { TagForm } from '@/components/forms/TagForm';
|
||||
import Link from 'next/link';
|
||||
import { SimpleHeader } from '@/components/ui/SimpleHeader';
|
||||
|
||||
interface TagsPageClientProps {
|
||||
initialTags: Tag[];
|
||||
@@ -82,31 +82,21 @@ export function TagsPageClient({ initialTags }: TagsPageClientProps) {
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[var(--background)]">
|
||||
{/* Header simplifié */}
|
||||
<div className="bg-[var(--card)]/80 backdrop-blur-sm border-b border-[var(--border)]/50">
|
||||
{/* Header uniforme */}
|
||||
<SimpleHeader
|
||||
title="TowerControl"
|
||||
subtitle="Tags - Gestion des étiquettes"
|
||||
syncing={loading}
|
||||
/>
|
||||
|
||||
{/* Header spécifique aux tags */}
|
||||
<div className="bg-[var(--card)]/50 border-b border-[var(--border)]/30">
|
||||
<div className="container mx-auto px-6 py-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-4">
|
||||
{/* Bouton retour */}
|
||||
<Link
|
||||
href="/"
|
||||
className="flex items-center justify-center w-10 h-10 rounded-lg bg-[var(--card)] border border-[var(--border)] hover:border-[var(--primary)]/50 hover:bg-[var(--card-hover)] transition-all duration-200 group"
|
||||
title="Retour au Kanban"
|
||||
>
|
||||
<svg
|
||||
className="w-5 h-5 text-[var(--muted-foreground)] group-hover:text-[var(--primary)] transition-colors"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</Link>
|
||||
|
||||
<div className="w-3 h-3 bg-[var(--accent)] rounded-full animate-pulse shadow-[var(--accent)]/50 shadow-lg"></div>
|
||||
<h1 className="text-xl font-mono font-bold text-[var(--foreground)] tracking-wider">
|
||||
<h2 className="text-lg font-mono font-bold text-[var(--foreground)] tracking-wider">
|
||||
Tags ({filteredAndSortedTags.length})
|
||||
</h1>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user