diff --git a/src/components/ui/Input/Input.tsx b/src/components/ui/Input/Input.tsx index 0ced004..8f523b2 100644 --- a/src/components/ui/Input/Input.tsx +++ b/src/components/ui/Input/Input.tsx @@ -11,14 +11,14 @@ interface TextInputProps extends InputHTMLAttributes { } const TextInput = ({ - placeholder, - onChange, - value, - borderStyle = "square", - password, - className = "", - ...props - }: TextInputProps) => { + placeholder = "", + onChange, + value = "", + borderStyle = "square", + password = false, + className = "", + ...props +}: TextInputProps) => { const [showPassword, setShowPassword] = useState(false); let inputBorderStyle = styles.square; @@ -28,15 +28,16 @@ const TextInput = ({ setShowPassword((prev) => !prev); }; - if (password) + if (password) { return (
-
); + } return ( { - // Vérifie explicitement que `events` est un tableau avant de trier - if (!Array.isArray(events)) return []; - return [...events].sort( - (a, b) => new Date(a.start) - new Date(b.start) - ); - }, [events]); - - return ( -
-

Liste des événements à venir

- {sortedEvents.length > 0 ? ( -
- {sortedEvents.map((eventGroup, index) => ( - - ))} -
- ) : ( -

Aucun événement planifié pour l'instant.

- )} -
- ); -} - -export default EventList;*/ import { useMemo, useContext } from "react"; import styles from "./EventList.module.css"; import EventItem from "./EventItem"; diff --git a/src/pages/Profile/ProfilePage.module.css b/src/pages/Profile/ProfilePage.module.css index 2bcecee..a47a7a7 100644 --- a/src/pages/Profile/ProfilePage.module.css +++ b/src/pages/Profile/ProfilePage.module.css @@ -1,4 +1,3 @@ -/* Conteneur principal */ .container { width: 100%; padding: 12px; @@ -113,7 +112,6 @@ margin: 0; } -/* Conteneur des informations principales */ .topDescription { display: flex; flex-direction: column; @@ -122,14 +120,12 @@ margin-bottom: 20px; } -/* Bloc d'informations */ .infoBlock { width: 100%; padding: 12px; box-sizing: border-box; } -/* Conteneur pour les paramètres */ .settingImage { width: 100%; display: flex; @@ -137,7 +133,6 @@ margin-top: 16px; } -/* Adaptation pour tablette et PC */ @media (min-width: 768px) { .contentWrapper { flex-direction: row; diff --git a/src/utils/date/formatDateLetter.ts b/src/utils/date/formatDateLetter.ts index f4c3f91..1da9160 100644 --- a/src/utils/date/formatDateLetter.ts +++ b/src/utils/date/formatDateLetter.ts @@ -1,35 +1,3 @@ - - -/*export function formatDateLetter(d) { - if (!d) return "Date inconnue"; - - const dateObj = new Date(d); - if (isNaN(dateObj.getTime())) return "Date invalide"; - - const monthNames = [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", - "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ]; - - const day = dateObj.getDate().toString().padStart(2, "0"); - const month = monthNames[dateObj.getMonth()]; - const year = dateObj.getFullYear(); - const hours = dateObj.getHours().toString().padStart(2, "0"); - const minutes = dateObj.getMinutes().toString().padStart(2, "0"); - - return `${day} ${month} ${year} à ${hours}:${minutes}`; -} - - -export function formatDateLetterJS(d) { - const monthNames = [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", - "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ]; - const [year, month, day] = d.split('-'); - return `${day} ${monthNames[parseInt(month) - 1]} ${year}`; -}*/ - export function formatDateLetter(d: string | Date | null | undefined): string { if (!d) return "Date inconnue"; diff --git a/src/utils/getUser.js b/src/utils/getUser.js index 6d71295..7a485b8 100644 --- a/src/utils/getUser.js +++ b/src/utils/getUser.js @@ -2,4 +2,4 @@ import fetchWrapper from "./fetchWrapper.js"; export default async function getUser() { return fetchWrapper("/api/users/me", null, "GET"); -} +} \ No newline at end of file