From 480c21bc8c0ffe0a4ff5586e4fd2c26efaf966e6 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Sat, 6 Jun 2026 13:56:47 +0100 Subject: [PATCH] fix(profiles): missing profile page --- frontend/src/pages/Profile.tsx | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 frontend/src/pages/Profile.tsx diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx new file mode 100644 index 0000000..1df29f8 --- /dev/null +++ b/frontend/src/pages/Profile.tsx @@ -0,0 +1,85 @@ +import { useState, useEffect } from "react"; +import { Eye, EyeOff, Copy, Check } from "lucide-react"; +import Box from "../components/Box.tsx"; +import { getUser } from "../utils/endpoints.ts"; +import type { User } from "../utils/types.ts"; + +const Profile = () => { + const [user, setUser] = useState(null); + const [keyVisible, setKeyVisible] = useState(false); + const [copied, setCopied] = useState(false); + + useEffect(() => { + getUser().then(setUser).catch(console.error); + }, []); + + const handleCopy = () => { + if (!user?.streamKey) return; + navigator.clipboard.writeText(user.streamKey); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + + if (!user) { + return ( +
+ Please log in to view your profile. +
+ ); + } + + return ( +
+

Profile

+ + + Profile picture +
+

{user.name}

+

@{user.username}

+

{user.email}

+

+ Member since {new Date(user.createdAt).toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" })} +

+
+
+ + +

Stream Key

+

+ Use this key in OBS or any RTMP-compatible software to start streaming. + Keep it private — anyone with this key can stream to your account. +

+ +
+
+ {keyVisible ? user.streamKey : "•".repeat(user.streamKey.length)} +
+ + + + +
+
+
+ ); +}; + +export default Profile;