-
{/* Glow background */}
@@ -138,7 +137,6 @@ const Signup = () => {
transition={{ duration: 0.5 }}
className="relative w-full max-w-md backdrop-blur-xl bg-white/5 border border-white/10 rounded-2xl p-8 shadow-[0_0_40px_rgba(34,197,94,0.15)]"
>
-
{/* Logo */}
@@ -160,7 +158,6 @@ const Signup = () => {
{/* Form */}
{/* Login redirect */}
@@ -245,10 +241,9 @@ const Signup = () => {
Log in
-
);
};
-export default Signup;
\ No newline at end of file
+export default Signup;
diff --git a/src/pages/createSession.tsx b/src/pages/createSession.tsx
new file mode 100644
index 0000000..602e08f
--- /dev/null
+++ b/src/pages/createSession.tsx
@@ -0,0 +1,89 @@
+import { useState } from "react";
+import { supabase } from "@/lib/supabase";
+import { useNavigate } from "react-router-dom";
+
+export default function CreateSession() {
+ const navigate = useNavigate();
+
+ const [title, setTitle] = useState("");
+ const [description, setDescription] = useState("");
+ const [date, setDate] = useState("");
+ const [time, setTime] = useState("");
+ const [seats, setSeats] = useState(10);
+ const [category, setCategory] = useState("");
+
+ const handleCreate = async () => {
+ const {
+ data: { user },
+ } = await supabase.auth.getUser();
+
+ const { error } = await supabase.from("sessions").insert([
+ {
+ title,
+ description,
+ date,
+ time,
+ seats,
+ category,
+ mentor_id: user?.id,
+ },
+ ]);
+
+ if (!error) {
+ alert("Session created");
+ navigate("/sessions");
+ }
+
+ console.log(error);
+ };
+
+ return (
+
+
Create Session
+
+ setTitle(e.target.value)}
+ className="border p-2 w-full mb-4"
+ />
+
+
+ );
+}