diff --git a/public/p1.png b/public/avatar/p1.png similarity index 100% rename from public/p1.png rename to public/avatar/p1.png diff --git a/src/app/(app)/profile/page.tsx b/src/app/(app)/profile/page.tsx index 84ca117..12cdef2 100644 --- a/src/app/(app)/profile/page.tsx +++ b/src/app/(app)/profile/page.tsx @@ -1,12 +1,31 @@ "use client"; -import React from "react"; +import { useEffect, useState } from "react"; import { useDevice } from "@/lib/context/DeviceContext"; -import { useRouter } from "next/navigation"; -export default function ProfilePage() { +function Mobile() { const { isAuthenticated, session } = useDevice(); + const [bio, setBio] = useState(""); + + function handleBioSubmit(e: React.FormEvent) { + e.preventDefault(); + if (bio.length > 0) { + const formData = new FormData(); + formData.append("bio", bio); + + fetch("/api/me", { + method: "POST", + body: formData, // Automatically sets Content-Type to multipart/form-data + }); + + // Show a success message + alert("Bio saved!"); + } else { + alert("Please enter a bio."); + } + } + return (
@@ -17,7 +36,7 @@ export default function ProfilePage() {
{isAuthenticated && ( Profile Preview @@ -28,12 +47,11 @@ export default function ProfilePage() {
- {/*

{bio || "No bio yet..."}

+

{bio || "No bio yet..."}