diff --git a/src/client/components/profile/ProfileNav.tsx b/src/client/components/profile/ProfileNav.tsx index 595b585..53c346d 100644 --- a/src/client/components/profile/ProfileNav.tsx +++ b/src/client/components/profile/ProfileNav.tsx @@ -1,14 +1,14 @@ import { cn } from "@/shared/utils"; import { Icon } from "@iconify/react"; -import { Link } from "@tanstack/react-router"; const SASE_COLORS = ["saseBlue", "saseGreen"]; interface ProfileNavProps { profileName?: string; + update: (section: string) => void; } -const ProfileNav: React.FC = ({ profileName = "User" }) => { +const ProfileNav: React.FC = ({ profileName = "User", update }) => { return (
{/* Profile Info */} @@ -23,52 +23,57 @@ const ProfileNav: React.FC = ({ profileName = "User" }) => {
); }; -const NavItem = ({ color, icon, text, to }: { icon: string; text: string; to: string; color: string }) => ( - - -
- void }) => { + const setActiveSection = () => { + const section = text.toLowerCase().replace(/\s+/g, ""); + update(section); + }; + + return ( +
- -); + /> +
+ + {text} + + +
+ + ); +}; export default ProfileNav; diff --git a/src/client/components/profile/UserInfoBox.tsx b/src/client/components/profile/UserInfoBox.tsx new file mode 100644 index 0000000..40b03cd --- /dev/null +++ b/src/client/components/profile/UserInfoBox.tsx @@ -0,0 +1,71 @@ +import { Icon } from "@iconify/react"; +import { useState } from "react"; + +const UserInfoBox = () => { + const [editMode, setEditMode] = useState(false); + + return ( +
+
+

User Info

+ +
+
+
+
+

Name:

+ +
+
+

UFID:

+ +
+
+

Bio:

+ +
+
+

Discord:

+ +
+
+

Roles:

+ +
+
+
+
+

Email:

+ +
+
+

Password:

+

[xxxxxxxxxxx]

+

2FA to reset password

+
+
+ +
+ +
+
+
+
+
+ +
+
+ ); +}; + +export default UserInfoBox; diff --git a/src/client/routes/profile.tsx b/src/client/routes/profile.tsx index 198590e..9be737e 100644 --- a/src/client/routes/profile.tsx +++ b/src/client/routes/profile.tsx @@ -2,6 +2,7 @@ import ProfileNav from "@components/profile/ProfileNav"; import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { useAuth } from "../AuthContext"; +import UserInfoBox from "../components/profile/UserInfoBox"; import { Button } from "../components/ui/button"; export const Route = createFileRoute("/profile")({ @@ -9,6 +10,15 @@ export const Route = createFileRoute("/profile")({ const [profile, setProfile] = useState<{ username: string } | null>(null); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); + const [activeSection, setActiveSection] = useState({ + account: true, + userinfo: false, + security: false, + attendance: false, + forms: false, + resources: false, + settings: false, + }); const { logout } = useAuth(); const navigate = useNavigate(); @@ -47,16 +57,32 @@ export const Route = createFileRoute("/profile")({ } }; + const updateComponent = (section: string) => { + setActiveSection({ + account: false, + userinfo: false, + security: false, + attendance: false, + forms: false, + resources: false, + settings: false, + }); + + setActiveSection((prev) => ({ ...prev, [section]: true })); + }; + if (isLoading) return
Loading...
; if (error) return
Error: {error}
; return (
- +
-
-
+
+ {activeSection.userinfo ? :
} + + {/*

Profile

@@ -64,12 +90,12 @@ export const Route = createFileRoute("/profile")({
{profile?.username?.charAt(0).toUpperCase()}
-

Welcome, {profile?.username}!

- +

Welcome, {profile?.username}!

-
+
*/} +
);