merge dev into admin

This commit is contained in:
p2405951 committed 2025-12-17 16:20:46 +01:00
commit d899379297
17 files changed
+528 -22

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import Background from "../../components/background/background.jsx";
import styles from "./PageNotFound.module.css"
import { useNavigate } from "react-router";
export default function PageNotFound() {
const navigate = useNavigate();
return <Background>
<div className={styles.content}>
<h1 className={styles.title}> Page non trouvée </h1>
<div className={`${styles.container} glassCard`}>
<p>
Désolé, la page que vous recherchez n’existe pas ou n’est plus disponible. <br/>
Vous pouvez : <br/>
- Vérifier l’URL pour une éventuelle erreur de saisie. <br/>
- Revenir à l’accueil <span onClick={() => navigate("/")} className={styles.redirectSpan}>ici.</span> <br/>
</p>
<p> Contact : contact@example.com </p>
</div>
</div>
</Background>
}
@@ -0,0 +1,33 @@
.title {
color: white;
font-size: xx-large;
margin-bottom: 20px;
}
.content {
display: flex;
flex-direction: column;
z-index: 2;
padding: 10px;
}
.container {
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 15px;
p {
font-size: large;
}
}
.redirectSpan {
color: blue;
text-decoration: underline;
}
.redirectSpan:hover {
cursor: pointer;
}
+2 -2
View File
@@ -31,12 +31,12 @@ function ProfilePage() {
</div>
<div className={styles.infoBlock}>
<p><strong>Mail :</strong> {user.email} </p>
<p><strong>Téléphone :</strong> {user.phone}</p>
<p><strong>Téléphone :</strong> {user.phone === null ? "Pas de numéro enregistré" : user.phone}</p>
</div>
<SettingsModal />
</div>
<h2>Vos Événements :</h2>
<h2>Tâches :</h2>
{user.tasks && user.tasks.length > 0 ? (
user.tasks.map((task, index) => (
<Task key={index} task={task} />
@@ -0,0 +1,69 @@
import styles from "./VolunteerProfilePage.module.css"
import { useParams } from "react-router";
import { useEffect, useState } from "react";
import getUserById from "../../utils/users/getUserById.js";
import formatDate from "../../utils/date/formatDate.js";
import Task from "../../components/Task/Task.jsx";
import { useNavigate } from "react-router";
export default function VolunteerProfilePage() {
const params = useParams();
const id = params.id;
const navigate = useNavigate();
const [user, setUser] = useState({});
useEffect(() => {
(async () => {
const result = await getUserById(id);
if (result?.error === 'not_found') {
navigate("/404");
} else {
setUser(result);
}
})();
}, [id]);
return <div className={styles.container}>
<div className={`${styles.profileboard} glassCard`}>
<div className={styles.contentWrapper}>
<div className={styles.profilePictureContainer}>
<img
src="/react.svg"
alt="Photo de profil"
className={styles.profilePicture}
/>
</div>
<div className={styles.description}>
<div className={styles.headerProfile}>
<h2> {user.name} {user.lastname} </h2>
</div>
<div className={styles.topDescription}>
<div className={styles.infoBlock}>
<p><strong>Role :</strong> {user.role}</p>
<p><strong>Membre depuis :</strong> {formatDate(user.created_at)}</p>
</div>
<div className={styles.infoBlock}>
<p><strong>Mail :</strong> {user.email} </p>
<p><strong>Téléphone :</strong> {user.phone === null ? "Pas de numéro enregistré" : user.phone}</p>
</div>
</div>
<h2>Tâches :</h2>
{user.tasks && user.tasks.length > 0 ? (
user.tasks.map((task, index) => (
<Task key={index} task={task} />
))
) : (
<p>Aucune tâche pour le moment.</p>
)}
</div>
</div>
</div>
</div>
}
@@ -0,0 +1,164 @@
.container {
width: 100%;
padding: 10px;
box-sizing: border-box;
}
.profileboard {
width: 100%;
padding: 15px;
border-radius: 20px;
box-sizing: border-box;
}
.contentWrapper {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.profilePictureContainer {
width: 120px;
height: 120px;
margin-bottom: 15px;
}
.profilePicture {
width: 100%;
height: 100%;
border-radius: 50%;
object-fit: cover;
}
.description {
width: 100%;
text-align: left;
margin-left:4%;
}
.topDescription {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
margin-bottom: 15px;
}
.infoBlock {
width: 100%;
background: rgba(255, 255, 255, 0.1);
padding: 10px;
border-radius: 5px;
}
.eventTasks {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out, opacity 0.2s ease;
opacity: 0;
padding-left: 20px;
}
.eventTasks.expanded {
max-height: 500px;
opacity: 1;
margin-top: 10px;
}
.description h2{
font-size:30px;
}
.profilePicture{
width:90%;
}
.settingsBtns {
display: flex;
gap: 5px;
justify-content: right;
}
@media screen and (min-width: 768px) {
.contentWrapper {
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
}
.profilePictureContainer {
width: 150px;
height: 150px;
margin-right: 20px;
margin-bottom: 0;
}
.description {
width: calc(100% - 170px);
margin-left:4%;
}
.topDescription {
flex-direction: row;
justify-content: space-between;
}
.infoBlock {
width: 48%;
}
.event {
padding: 15px;
}
.description h2{
font-size:30px;
}
.profilePicture{
width:90%;
}
}
.description button{
width:50px;
height:50px;
}
.headerProfile {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
/* Desktop (1024px et plus) */
@media screen and (min-width: 1024px) {
.container {
max-width: 100%;
margin: 0 auto;
padding: 20px;
}
.profileboard {
padding: 25px;
}
.profilePictureContainer {
width: 30%;
height:auto;
}
.profilePicture{
width:90%;
}
.description {
width: calc(100% - 200px);
margin-left:4%;
}
.event {
padding: 18px;
}
.description h2{
font-size:30px;
}
}
@@ -0,0 +1,30 @@
import styles from "./validationErrorPage.module.css"
import Background from "../../components/background/background.jsx";
import Button from "../../components/ui/button/button.jsx";
import { useContext } from "react";
import { AuthContext } from "../../contexts/auth/AuthContext.js";
import { Navigate, useNavigate } from "react-router";
export default function ValidationErrorPage() {
const { logout, user } = useContext(AuthContext);
const navigate = useNavigate();
const handleLogout = async () => {
await logout();
navigate("/login");
}
if(user && user.validate === 1) return <Navigate to="/" />;
return <Background>
<div className={styles.content}>
<h1 className={styles.title}> Votre compte n'a pas été validé </h1>
<div className={`${styles.container} glassCard`}>
<p> Votre compte n'a pas encore été validé, veuillez attendre la vérification de votre compte par un membre autorisé. </p>
<p> Contact : contact@example.com </p>
<Button variant={"danger"} onClick={handleLogout}> Déconnexion </Button>
</div>
</div>
</Background>
}
@@ -0,0 +1,25 @@
.title {
color: white;
font-size: xx-large;
margin-bottom: 20px;
}
.content {
display: flex;
flex-direction: column;
z-index: 2;
padding: 10px;
}
.container {
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 15px;
p {
font-size: large;
}
}