diff --git a/src/components/ui/Modal/Modal.module.css b/src/components/ui/Modal/Modal.module.css
index fa3566f..8e97c9d 100644
--- a/src/components/ui/Modal/Modal.module.css
+++ b/src/components/ui/Modal/Modal.module.css
@@ -14,19 +14,14 @@
}
.modal {
- padding: 20px 20px 20px 20px;
- border-radius: 8px;
+ border-radius: 20px;
min-width: 300px;
max-width: 70%;
max-height: none;
position: relative;
- box-shadow: 0 4px 15px rgba(0,0,0,0.2);
width: clamp(300px, 50vw, 600px);
- border: 1px solid rgba(200, 200, 200, 0.3);
- background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
- color: #000;
outline: none;
}
@@ -34,5 +29,4 @@
display: flex;
align-items: center;
justify-content: center;
- margin-top: 20px;
}
diff --git a/src/components/ui/Modal/Modal.tsx b/src/components/ui/Modal/Modal.tsx
index b1203ed..9cffb35 100644
--- a/src/components/ui/Modal/Modal.tsx
+++ b/src/components/ui/Modal/Modal.tsx
@@ -1,35 +1,3 @@
-/*import { createPortal } from "react-dom";
-import styles from "./modal.module.css";
-import Button from "../button/button.jsx";
-
-const Modal = ({ open, onClose, children, title }) => {
-
- if (!open) return null;
-
- const handleOverlayClick = () => {
- onClose();
- };
-
- const handleModalClick = (e) => {
- e.stopPropagation();
- };
-
- return createPortal(
-
-
+
{title &&
{title}
}
{children}
-
+
,
diff --git a/src/index.css b/src/index.css
index c18fc90..601e888 100644
--- a/src/index.css
+++ b/src/index.css
@@ -17,6 +17,13 @@ html {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
+
+ --glass-back: rgba(255, 255, 255, 0.54);
+ --glass-border: rgba(255, 255, 255, 0.2);
+ --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
+ inset 0 1px 0 rgba(255, 255, 255, 0.3),
+ inset 0 -1px 0 rgba(255, 255, 255, 0.05),
+ inset 0 0 8px 4px rgba(255, 255, 255, 0.2);
}
@media screen and (max-width: 768px) {
@@ -51,18 +58,23 @@ body {
min-height: 100vh;
}
+body.dark {
+ --glass-back: rgba(191, 191, 191, 0.54);
+ --glass-border: rgba(191, 191, 191, 0.2);
+ --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
+ inset 0 1px 0 rgba(191, 191, 191, 0.3),
+ inset 0 -1px 0 rgba(191, 191, 191, 0.05),
+ inset 0 0 8px 4px rgba(191, 191, 191, 0.2);
+}
.glassCard {
padding: 10px 20px 10px 20px;
- background: rgba(255, 255, 255, 0.54);
+ background: var(--glass-back);
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
border-radius: 20px;
- border: 1px solid rgba(255, 255, 255, 0.2);
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
- inset 0 1px 0 rgba(255, 255, 255, 0.3),
- inset 0 -1px 0 rgba(255, 255, 255, 0.05),
- inset 0 0 8px 4px rgba(255, 255, 255, 0.2);
+ border: 1px solid var(--glass-border);
+ box-shadow: var(--glass-shadow);
}
.glassBorder{
diff --git a/src/pages/EventDetail/components/CreateTaskBtn/CreateTaskBtn.jsx b/src/pages/EventDetail/components/CreateTaskBtn/CreateTaskBtn.jsx
new file mode 100644
index 0000000..81704a9
--- /dev/null
+++ b/src/pages/EventDetail/components/CreateTaskBtn/CreateTaskBtn.jsx
@@ -0,0 +1,116 @@
+import styles from "../../EventDetailPage.module.css";
+import Button from "../../../../components/ui/Button/Button";
+import {useContext, useState} from "react";
+import TextInput from "../../../../components/ui/Input/Input";
+import Modal from "../../../../components/ui/Modal/Modal";
+import createTaskApi from "../../../../utils/tasks/createTask.js";
+import {EventDetailContext} from "../../../../contexts/EventDetail/EventDetailContext.js";
+
+export default function CreateTaskBtn({ id }) {
+
+ const [openTaskModal, setOpenTaskModal] = useState(false);
+
+ const [taskName, setTaskName] = useState("");
+ const [taskDescription, setTaskDescription] = useState("");
+ const [taskLocation, setTaskLocation] = useState("");
+ const [maxParticipants, setMaxParticipants] = useState("");
+ const [startTime, setStartTime] = useState("");
+ const [endTime, setEndTime] = useState("");
+
+ const { updateEventInfo } = useContext(EventDetailContext)
+
+ const createTask = async () => {
+ const data = await createTaskApi({
+ eventId: id,
+ name: taskName,
+ description: taskDescription,
+ start: startTime,
+ end: endTime,
+ location: taskLocation,
+ maxParticipants,
+ });
+
+ if (data?.status === 200) {
+ setOpenTaskModal(false);
+ setTaskName("");
+ setTaskDescription("");
+ setTaskLocation("");
+ setMaxParticipants("");
+ setStartTime("");
+ setEndTime("");
+
+ updateEventInfo(id)
+ } else {
+ console.log("⚠️ Échec de la création de la task");
+ }
+ };
+
+ return <>
+
+
+
+
setOpenTaskModal(false)} title={"Créer tâche"}>
+
+
+
+
Nom de la tâche
+
setTaskName(e.target.value)}
+ placeholder="Nom de la tâche"
+ />
+
+
+
+
Description
+
setTaskDescription(e.target.value)}
+ placeholder="Description de la tâche"
+ />
+
+
+
+
Lieu
+
setTaskLocation(e.target.value)}
+ placeholder="Lieu"
+ />
+
+
+
+
Nombre de participants max
+
setMaxParticipants(e.target.value)}
+ placeholder="Participants max"
+ />
+
+
+
+
Heure de début
+
setStartTime(e.target.value)}
+ />
+
+
+
+
Heure de fin
+
setEndTime(e.target.value)}
+ />
+
+
+
+
+
+
+
+ >
+}
\ No newline at end of file
diff --git a/src/pages/Profile/ProfilePage.module.css b/src/pages/Profile/ProfilePage.module.css
index 288c0d1..1e3cc3a 100644
--- a/src/pages/Profile/ProfilePage.module.css
+++ b/src/pages/Profile/ProfilePage.module.css
@@ -12,7 +12,7 @@
box-sizing: border-box;
}
-.settingImage {
+.settingAccount {
display: flex;
justify-content: center;
align-items: center;
@@ -126,7 +126,7 @@
box-sizing: border-box;
}
-.settingImage {
+.settingAcount {
width: 100%;
display: flex;
justify-content: center;
diff --git a/src/pages/Profile/ProfilePage.tsx b/src/pages/Profile/ProfilePage.tsx
index 18af636..ef09a69 100644
--- a/src/pages/Profile/ProfilePage.tsx
+++ b/src/pages/Profile/ProfilePage.tsx
@@ -144,6 +144,11 @@ function ProfilePage() {
{user?.isAdmin && profileUser && !isOwnProfile && (
)}
+ {isOwnProfile && (
+
+
+
+ )}