diff --git a/client/pages/Activity.tsx b/client/pages/Activity.tsx new file mode 100644 index 00000000..1163522f --- /dev/null +++ b/client/pages/Activity.tsx @@ -0,0 +1,151 @@ +import { useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import { useDiscordActivity } from "@/contexts/DiscordActivityContext"; +import LoadingScreen from "@/components/LoadingScreen"; +import { useAuth } from "@/contexts/AuthContext"; +import Dashboard from "./Dashboard"; + +export default function Activity() { + const navigate = useNavigate(); + const { isActivity, isLoading, user, error } = useDiscordActivity(); + const { user: authUser } = useAuth(); + + useEffect(() => { + if (!isActivity && !isLoading) { + navigate("/", { replace: true }); + } + }, [isActivity, isLoading, navigate]); + + if (isLoading) { + return ( + + ); + } + + if (error) { + return ( +
+
+

+ ❌ Activity Error +

+

{error}

+

+ Please try opening the Activity again in Discord. +

+
+
+ ); + } + + if (!isActivity) { + return null; + } + + if (user) { + return ( +
+
+
+

+ Welcome to AeThex, {user.full_name || user.username}! 🎉 +

+

Discord Activity

+
+ +
+
+

+ 👤 Your Profile +

+ {user.avatar_url && ( + {user.full_name + )} +

+ Name: {user.full_name || "Not set"} +

+

+ Username: {user.username || "Not set"} +

+

+ Type: {user.user_type || "community_member"} +

+ {user.bio && ( +

"{user.bio}"

+ )} +
+ +
+

+ ⚔️ Your Realm +

+

+ {user.primary_arm?.toUpperCase() || "LABS"} +

+

+ Your primary realm determines your Discord role and access to + realm-specific features. +

+ +
+
+ +
+

+ 🚀 Quick Actions +

+
+ + 🎨 Browse Creators + + + 💼 Find Opportunities + + + ⚙️ Settings + +
+
+ +
+

+ 💡 Tip: Use Discord commands like{" "} + /profile,{" "} + /set-realm, + and{" "} + /verify-role{" "} + to manage your account within Discord. +

+
+
+
+ ); + } + + return ( + + ); +}