From cdbacfebb5d164ebd656b9532f57317707d5da9c Mon Sep 17 00:00:00 2001 From: Andil Date: Sat, 15 Aug 2026 08:39:14 +0000 Subject: [PATCH 1/2] ci: validate end-to-end deployment From 047d34f59bd9dfaa14928b3511934d7bf4696d61 Mon Sep 17 00:00:00 2001 From: Andil Date: Mon, 17 Aug 2026 14:54:58 +0000 Subject: [PATCH 2/2] fix: resolve frontend lint issues --- frontend/src/components/Footer.jsx | 147 +++++++++++------------- frontend/src/context/AuthContext.jsx | 2 + frontend/src/pages/Admin.jsx | 4 +- frontend/src/pages/MesGains.jsx | 15 ++- frontend/src/pages/Profile.jsx | 10 +- frontend/src/pages/SaisirCodeUnique.jsx | 3 - 6 files changed, 85 insertions(+), 96 deletions(-) diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx index 1c673df..b2189dd 100644 --- a/frontend/src/components/Footer.jsx +++ b/frontend/src/components/Footer.jsx @@ -1,125 +1,119 @@ import { Link, useLocation } from 'react-router-dom' import { useAuth } from '../context/AuthContext' - + +function FooterLink({ to, children, className = '', pathname }) { + return pathname === to ? ( + {children} + ) : ( + + {children} + + ) +} + export default function Footer() { const { pathname } = useLocation() const { user } = useAuth() const isLoggedIn = !!user - - function FooterLink({ to, children, className=''}) { - return pathname === to ? ( - {children} - ) : ( - - {children} - - ) - } + return (
- - + {/* Partie principale */}
- - + {/* Logo */}
- +

Thé Tip Top

- +

Participez au jeu-concours Thé Tip Top et tentez de gagner des lots gourmands autour du thé.

-
- - - + {/* Navigation */}
-

Navigation

- - +
    - +
  • Accueil
  • - - +
  • Règles du jeu
  • - - +
  • Tester mon code
  • - - { !isLoggedIn && ( + + {!isLoggedIn && (
  • Créer un compte
  • )} - +
-
- - - - + {/* Informations légales */}
-

Informations

- - +
    - +
  • Mentions légales
  • - - +
  • Politique de confidentialité @@ -129,6 +123,7 @@ export default function Footer() {
  • Accessibilité @@ -138,78 +133,73 @@ export default function Footer() {
  • CGU
  • -
  • Contact
  • - +
  • Plan du site
  • - +
-
- - - - + {/* Contact */}
-

Contact

- +

Une question sur le jeu ?

- - + + 01 84 80 20 34 - - + + contact@thetiptop.fr - +

18 rue Léon Frot
75011 Paris, France

- -
- - +
- - - + {/* Barre basse */} -
-
- - +

© {new Date().getFullYear()} Thé Tip Top. Tous droits réservés.
@@ -217,8 +207,9 @@ export default function Footer() { Projet étudiant fictif — aucun achat ni réservation réel ne peut être effectué sur ce site.

- + - -
-
- - +
) -} \ No newline at end of file +} diff --git a/frontend/src/context/AuthContext.jsx b/frontend/src/context/AuthContext.jsx index 552cb66..5035bb7 100644 --- a/frontend/src/context/AuthContext.jsx +++ b/frontend/src/context/AuthContext.jsx @@ -1,3 +1,5 @@ +/* eslint-disable react-refresh/only-export-components */ + import { createContext, useContext, useState } from 'react' const AuthContext = createContext(null) diff --git a/frontend/src/pages/Admin.jsx b/frontend/src/pages/Admin.jsx index 4272e81..94c0750 100644 --- a/frontend/src/pages/Admin.jsx +++ b/frontend/src/pages/Admin.jsx @@ -56,7 +56,7 @@ export default function Admin() { if (!handleAuthError(e)) setError(e.message) }) .finally(() => setLoading(false)) - }, []) + }, [handleAuthError]) const handleDraw = async () => { setShowConfirm(false) @@ -94,7 +94,7 @@ export default function Admin() { const csv = [header, ...rows] .map((row) => row.map((cell) => `"${String(cell).replace(/"/g, '""')}"`).join(';')) .join('\n') - const blob = new Blob([`${csv}`], { type: 'text/csv;charset=utf-8;' }) + const blob = new Blob(['\uFEFF' + csv], { type: 'text/csv;charset=utf-8;' }) const url = URL.createObjectURL(blob) const link = document.createElement('a') link.href = url diff --git a/frontend/src/pages/MesGains.jsx b/frontend/src/pages/MesGains.jsx index dcb45f3..d432a44 100644 --- a/frontend/src/pages/MesGains.jsx +++ b/frontend/src/pages/MesGains.jsx @@ -50,7 +50,20 @@ export default function MesGains() { } }, [handleAuthError]) - useEffect(() => { fetchGains() }, [fetchGains]) + useEffect(() => { + const loadGains = async () => { + try { + const data = await myGainsApi() + setGains(data.gains) + } catch (err) { + if (!handleAuthError(err)) setError(err.message) + } finally { + setLoading(false) + } + } + + loadGains() +}, [handleAuthError]) return (
diff --git a/frontend/src/pages/Profile.jsx b/frontend/src/pages/Profile.jsx index 612d848..5861aef 100644 --- a/frontend/src/pages/Profile.jsx +++ b/frontend/src/pages/Profile.jsx @@ -1,20 +1,12 @@ import { useState } from 'react' -import { useNavigate } from 'react-router-dom' import UserNav from '../components/UserNav' -import { changePasswordApi, deleteAccountApi } from '../services/auth' +import { changePasswordApi} from '../services/auth' import { useHandleAuthError } from '../hooks/useHandleAuthError' -import { useAuth } from '../context/AuthContext' export default function Profile() { const user = JSON.parse(localStorage.getItem('user') || '{}') const initials = `${(user.firstname || '?')[0]}${(user.lastname || '?')[0]}`.toUpperCase() const handleAuthError = useHandleAuthError() - const { logout } = useAuth() - const navigate = useNavigate() - - const [showDeleteModal, setShowDeleteModal] = useState(false) - const [deleting, setDeleting] = useState(false) - const [deleteError, setDeleteError] = useState('') const [pwForm, setPwForm] = useState({ currentPassword: '', newPassword: '', confirmPassword: '' }) const [showPw, setShowPw] = useState({ current: false, new: false, confirm: false }) diff --git a/frontend/src/pages/SaisirCodeUnique.jsx b/frontend/src/pages/SaisirCodeUnique.jsx index 60e4bf9..3b3ccba 100644 --- a/frontend/src/pages/SaisirCodeUnique.jsx +++ b/frontend/src/pages/SaisirCodeUnique.jsx @@ -17,7 +17,6 @@ export default function SaisirCodeUnique() { const [code, setCode] = useState('') const [loading, setLoading] = useState(false) const [gain, setGain] = useState(null) - const [claim, setClaim] = useState(null) const [wonAt, setWonAt] = useState(null) const [showDetail, setShowDetail] = useState(false) @@ -27,7 +26,6 @@ export default function SaisirCodeUnique() { try { const data = await participateApi(code.trim().toUpperCase()) setGain(data.gain) - setClaim(data.claim) setWonAt(new Date()) } catch (err) { if (!handleAuthError(err)) { @@ -40,7 +38,6 @@ export default function SaisirCodeUnique() { const handleClose = () => { setGain(null) - setClaim(null) setWonAt(null) setShowDetail(false) setCode('')