chore: Initial Commit

feat: Gestion des inscriptions [#1]
feat(frontend): Création des vues pour le paramétrage de l'école [#2]
feat: Gestion du login [#6]
fix: Correction lors de la migration des modèle [#8]
feat: Révision du menu principal [#9]
feat: Ajout d'un footer [#10]
feat: Création des dockers compose pour les environnements de
développement et de production [#12]
doc(ci): Mise en place de Husky et d'un suivi de version automatique [#14]
This commit is contained in:
Luc SORIGNET
2024-11-18 10:02:58 +01:00
committed by N3WT DE COMPET
commit af0cd1c840
228 changed files with 22694 additions and 0 deletions

View File

@ -0,0 +1,52 @@
import React from 'react';
import { usePlanning } from '@/context/PlanningContext';
import { format } from 'date-fns';
import { fr } from 'date-fns/locale';
import { getMonthEventCount } from '@/utils/events';
import { isSameMonth } from 'date-fns';
const MonthCard = ({ month, eventCount, onClick }) => (
<div
className={`bg-white p-4 rounded shadow hover:shadow-lg cursor-pointer
${isSameMonth(month, new Date()) ? 'ring-2 ring-emerald-500' : ''}`}
onClick={onClick}
>
<h3 className="font-medium text-center mb-2">
{format(month, 'MMMM', { locale: fr })}
</h3>
<div className="text-center text-sm">
<span className="inline-flex items-center justify-center bg-emerald-100 text-emerald-800 px-2 py-1 rounded-full">
{eventCount} événements
</span>
</div>
</div>
);
const YearView = ({ onDateClick }) => {
const { currentDate, events, setViewType, setCurrentDate } = usePlanning();
const months = Array.from(
{ length: 12 },
(_, i) => new Date(currentDate.getFullYear(), i, 1)
);
const handleMonthClick = (month) => {
setCurrentDate(month);
setViewType('month');
};
return (
<div className="grid grid-cols-4 gap-4 p-4">
{months.map(month => (
<MonthCard
key={month.getTime()}
month={month}
eventCount={getMonthEventCount(month, events)}
onClick={() => handleMonthClick(month)}
/>
))}
</div>
);
};
export default YearView;