diff --git a/client/pages/Community.tsx b/client/pages/Community.tsx index c2452ab1..78805f0f 100644 --- a/client/pages/Community.tsx +++ b/client/pages/Community.tsx @@ -1,5 +1,3 @@ -import { useCallback, useEffect, useRef, useState, type FormEvent } from "react"; -import Layout from "@/components/Layout"; import { Button } from "@/components/ui/button"; import { Card, @@ -454,557 +452,105 @@ function EventCard({ ); } -export default function Community() { - const [isLoading, setIsLoading] = useState(true); - const toastShownRef = useRef(false); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLoading(false); - if (!toastShownRef.current) { - aethexToast.system("Community hub connected"); - toastShownRef.current = true; - } - }, 1000); - - return () => clearTimeout(timer); - }, []); - - const platforms = [ - { - name: "Discord Server", - description: "Real-time chat with developers and get instant help", - icon: MessageSquare, - members: "15K+ members", - activity: "500+ daily active", - link: "/discord", - color: "from-purple-500 to-indigo-600", - }, - { - name: "GitHub Community", - description: "Contribute to open source projects and share code", - icon: Github, - members: "8K+ contributors", - activity: "200+ repositories", - link: "/github", - color: "from-gray-700 to-gray-900", - }, - { - name: "Twitter Community", - description: "Follow the latest updates and join conversations", - icon: Twitter, - members: "25K+ followers", - activity: "Daily updates", - link: "/twitter", - color: "from-blue-400 to-blue-600", - }, - ]; - - const events: CommunityEvent[] = [ - { - id: "aethex-game-jam-2025", - title: "AeThex Game Jam 2025", - date: "January 17-19, 2025", - location: "Online", - type: "Competition", - participants: 500, - prize: "$10,000 grand prize", - status: "Registration Open", - description: - "A 48-hour remote jam where cross-discipline teams ship a playable build and pitch their live-ops plan to AeThex Studios.", - agenda: [ - "Day 1, 9:00 AM PST — Theme reveal, team sync, and tech check", - "Day 2, 12:00 PM PST — Mentor office hours and vertical slice review", - "Day 3, 3:00 PM PST — Final submissions, judging, and community showcase", - ], - registrationEnabled: true, - registrationUrl: "https://devconnect.sbs/events/game-jam-2025", - }, - { - id: "weekly-developer-meetup", - title: "Weekly Developer Meetup", - date: "Every Wednesday, 7:00 PM PST", - location: "DevConnect Studio Lounge", - type: "Meetup", - participants: 80, - prize: null, - status: "Recurring", - description: - "An ongoing roundtable for sharing progress, pairing on blockers, and highlighting new community tools across AeThex projects.", - agenda: [ - "15 min — Lightning updates from active squads", - "30 min — Deep-dive breakout rooms hosted by AeThex mentors", - "15 min — Open Q&A and contributor shout-outs", - ], - registrationEnabled: true, - registrationUrl: "https://devconnect.sbs/events/weekly-meetup", - }, - { - id: "ai-in-games-workshop", - title: "AI in Games Workshop", - date: "December 20, 2024", - location: "San Francisco HQ + Live Stream", - type: "Workshop", - participants: 120, - prize: null, - status: "Upcoming", - description: - "Hands-on sessions covering inference optimization, procedural storytelling, and guardrailed AI systems for live games.", - agenda: [ - "Session 1 — Deploying performant ML models on AeThex Edge", - "Session 2 — Narrative design with adaptive dialogue tooling", - "Session 3 — Compliance, telemetry, and post-launch monitoring", - ], - registrationEnabled: true, - registrationUrl: "https://devconnect.sbs/events/ai-games", - }, - ]; - - const contributors = [ - { - name: "Alex Developer", - avatar: - "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100&h=100&fit=crop&crop=face", - title: "Community Leader", - contributions: 156, - badge: "🏆 Top Contributor", - speciality: "Game Development", - }, - { - name: "Sarah Coder", - avatar: - "https://images.unsplash.com/photo-1494790108755-2616b612b029?w=100&h=100&fit=crop&crop=face", - title: "Documentation Expert", - contributions: 89, - badge: "📚 Knowledge Hero", - speciality: "Technical Writing", - }, - { - name: "Jordan AI", - avatar: - "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100&h=100&fit=crop&crop=face", - title: "AI Researcher", - contributions: 134, - badge: "🧠 AI Pioneer", - speciality: "Machine Learning", - }, - ]; - - const stats = [ - { label: "Community Members", value: "50K+", icon: Users }, - { label: "Daily Messages", value: "2K+", icon: MessageCircle }, - { label: "Open Source Projects", value: "200+", icon: Code }, - { label: "Games Created", value: "1K+", icon: Gamepad2 }, - ]; - - const devConnectHighlights = [ - { - title: "Unified Creator Profiles", - description: - "Showcase your AeThex achievements, GitHub contributions, and live projects in one public hub.", - icon: Users, - }, - { - title: "Real-time Collaboration Rooms", - description: - "Spin up focused channels with voice, video, and whiteboards tailored for each build sprint.", - icon: MessageCircle, - }, - { - title: "Integrated Delivery Pipeline", - description: - "Track deployments, alerts, and community feedback with automated insights across your stack.", - icon: TrendingUp, - }, - ]; - - const [registeredEvents, setRegisteredEvents] = useState>({}); - - const handleEventRegistration = useCallback( - (eventData: CommunityEvent, payload: EventRegistrationPayload) => { - setRegisteredEvents((prev) => ({ - ...prev, - [eventData.id]: payload, - })); - - const firstName = payload.name.split(" ")[0] || payload.name; - aethexToast.system( - `${firstName}, you're registered for ${eventData.title}. Confirmation sent to ${payload.email}.`, - ); - }, - [], - ); - - if (isLoading) { - return ( - - ); - } +interface SectionHeaderProps { + badge?: string; + title: string; + description: string; + align?: "center" | "left"; +} +function SectionHeader({ badge, title, description, align = "center" }: SectionHeaderProps) { + const containerClass = align === "center" ? "mx-auto text-center" : "text-left"; return ( - -
- {/* Hero Section */} -
-
-
- - - AeThex Community - - -

- - Join the Innovation Network - -

- -

- Connect with developers, creators, and innovators from around - the world. Share knowledge, collaborate on projects, and grow - together. -

- -
- - -
-
-
-
- - {/* Community Stats */} -
-
-
- {stats.map((stat, index) => { - const Icon = stat.icon; - return ( -
-
-
- -
-
-
-
- {stat.value} -
-

- {stat.label} -

-
-
- ); - })} -
-
-
- - {/* Community Platforms */} -
-
-
-

- Connect on Your Favorite Platform -

-

- Multiple ways to engage with the AeThex community -

-
- -
- {platforms.map((platform, index) => { - const Icon = platform.icon; - return ( - - -
- -
- {platform.name} - {platform.description} -
- -
-
- Members: - - {platform.members} - -
-
- Activity: - - {platform.activity} - -
-
- - -
-
- ); - })} -
-
-
- - {/* DevConnect Spotlight */} -
-
-
-
-
- - New Platform - -

- Introducing DevConnect -

-

- DevConnect is our dedicated hub for platform teams building the - next wave of AeThex experiences. Launch collabs, monitor live - services, and activate the Studio network — all from one - command center. -

-
- - -
-
- - -
- {devConnectHighlights.map((highlight, index) => { - const Icon = highlight.icon; - return ( -
-
- -
-
-

- {highlight.title} -

-

- {highlight.description} -

-
-
- ); - })} -
-
- DevConnect syncs directly with AeThex profiles, so your - activity, streaks, and achievements follow you across every - build. -
-
-
-
-
-
- - {/* Upcoming Events */} -
-
-
-

- Upcoming Events -

-

- Join our community events and level up your skills -

-
- -
- {events.map((event, index) => ( - handleEventRegistration(event, payload)} - /> - ))} -
-
-
- - {/* Top Contributors */} -
-
-
-

- Community Heroes -

-

- Recognizing our most active and helpful community members -

-
- -
- {contributors.map((contributor, index) => ( - - - {contributor.name} -

- {contributor.name} -

-

- {contributor.title} -

- - {contributor.speciality} - - -
-
- {contributor.contributions} -
-
- Contributions -
-
- {contributor.badge} -
-
-
-
- ))} -
-
-
- - {/* CTA Section */} -
-
-
-

- Ready to Join Our Community? -

-

- Connect with thousands of developers, share your projects, and - grow your skills in our supportive and innovative community. -

- -
- - -
- -
-
- -

Weekly Meetups

-

- Virtual coffee chats -

-
-
- -

Recognition

-

- Contributor rewards -

-
-
- -

Growth

-

- Learn & advance -

-
-
-
-
-
-
-
+
+ {badge && ( + + {badge} + + )} +

{title}

+

{description}

+
); } + +interface PollCardProps { + poll: CommunityPoll; + selectedOption?: string; + onSelect: (optionId: string) => void; +} + +function PollCard({ poll, selectedOption, onSelect }: PollCardProps) { + const totalVotes = poll.options.reduce((sum, option) => sum + option.votes, 0); + + return ( + + +
+ + + Community Poll + + + + {poll.closesIn} + +
+ {poll.question} +
+ +
+ {poll.options.map((option) => { + const percentage = totalVotes === 0 ? 0 : Math.round((option.votes / totalVotes) * 100); + const isSelected = selectedOption === option.id; + const TrendIcon = option.trend === "up" ? TrendingUp : option.trend === "down" ? ArrowDown : ArrowRight; + + return ( + + ); + })} +
+
+ {totalVotes} votes recorded + + Live insight + +
+
+
+ ); +} + +export default function Community() { \ No newline at end of file