diff --git a/src/pages/dashboard/dashboard.css b/src/pages/dashboard/dashboard.css index 99de33a4..1defa6ac 100644 --- a/src/pages/dashboard/dashboard.css +++ b/src/pages/dashboard/dashboard.css @@ -1,3 +1,105 @@ +/* Dashboard Layout */ +.dashboard-layout { + display: flex; + min-height: 100vh; + background-color: var(--ifm-background-color); +} + +/* Sidebar Styles */ +.dashboard-sidebar { + width: 250px; + background: var(--ifm-card-background-color); + border-right: 1px solid var(--ifm-toc-border-color); + padding: 1.5rem 0; + position: fixed; + height: 100vh; + overflow-y: auto; + z-index: 100; +} + +.sidebar-logo { + padding: 0 1.5rem 1.5rem; + border-bottom: 1px solid var(--ifm-toc-border-color); + margin-bottom: 1.5rem; +} + +.sidebar-logo h2 { + margin: 0; + color: var(--ifm-color-primary); +} + +.sidebar-nav { + list-style: none; + padding: 0; + margin: 0; +} + +.nav-item { + display: flex; + align-items: center; + padding: 0.75rem 1.5rem; + cursor: pointer; + transition: all 0.2s ease; + color: var(--ifm-font-color-base); +} + +.nav-item:hover { + background: var(--ifm-menu-color-background-active); + color: var(--ifm-color-primary); +} + +.nav-item.active { + background: var(--ifm-menu-color-background-active); + border-left: 3px solid var(--ifm-color-primary); + color: var(--ifm-color-primary); + font-weight: 600; +} + +.nav-icon { + margin-right: 0.75rem; + font-size: 1.25rem; +} + +/* Main Content */ +.dashboard-main { + flex: 1; + margin-left: 250px; /* Match sidebar width */ + padding: 2rem; + max-width: calc(100% - 250px); +} + +.dashboard-main.discuss-view { + max-width: 100%; +} + +/* Discussion Section */ +.discussion-container { + max-width: 800px; + margin: 0 auto; + padding: 2rem 0; +} + +.discussion-container h2 { + font-size: 2rem; + margin-bottom: 1rem; + color: var(--ifm-heading-color); +} + +.discussion-container p { + color: var(--ifm-color-emphasis-700); + margin-bottom: 2rem; + font-size: 1.1rem; + line-height: 1.6; +} + +.giscus-container { + margin-top: 2rem; + background: var(--ifm-card-background-color); + border-radius: 8px; + padding: 2rem; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); +} + /* Dashboard Container */ .dashboard-container { max-width: 1200px; diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 332837b4..ff075b8d 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -4,6 +4,8 @@ import Head from "@docusaurus/Head"; import { motion } from "framer-motion"; import { useCommunityStatsContext, CommunityStatsProvider } from "@site/src/lib/statsProvider"; import SlotCounter from "react-slot-counter"; +import Giscus from "@giscus/react"; +import { useLocation, useHistory } from "@docusaurus/router"; import "./dashboard.css"; interface LeaderboardEntry { @@ -24,7 +26,30 @@ interface DashboardStats { topContributors: LeaderboardEntry[]; } -const Dashboard: React.FC = () => { +const DashboardContent: React.FC = () => { + const location = useLocation(); + const history = useHistory(); + const [activeTab, setActiveTab] = useState<'home' | 'discuss'>('home'); + + useEffect(() => { + // Set active tab based on URL hash + if (location.hash === '#discuss') { + setActiveTab('discuss'); + } else { + setActiveTab('home'); + } + }, [location]); + + const handleTabChange = (tab: 'home' | 'discuss') => { + setActiveTab(tab); + if (tab === 'discuss') { + history.push('#discuss'); + window.scrollTo(0, 0); + } else { + history.push('#'); + } + }; + const { githubStarCount, githubStarCountText, @@ -132,7 +157,7 @@ const Dashboard: React.FC = () => { value={valueText} autoAnimationStart={true} duration={1} - className="dashboard-slot-counter" + className="dashboard-slot-counter-value" /> )} @@ -191,143 +216,187 @@ const Dashboard: React.FC = () => { ); return ( - + - Dashboard - RecodeHive - + RecodeHive | Dashboard + - -
- {/* Hero Section */} - -
-

- Community Dashboard -

-

- Track our community's growth, celebrate top contributors, and explore project statistics -

+
+ {/* Side Navigation */} + - {/* Stats Grid */} - -
- - - - -
-
+
+ {activeTab === 'home' ? ( +
+ {/* Hero Section */} + +
+

+ Community Dashboard +

+

+ Track our community's growth, celebrate top contributors, and explore project statistics +

+
+
- {/* Leaderboard Section */} - -
-

- 🏆 Top Contributors Leaderboard -

-

- Celebrating our most active community members who make RecodHive awesome! -

-
+ {/* Stats Grid */} + +
+ + + + +
+
-
- {error && ( -
-

⚠️ Some data may be cached or incomplete

-
- )} - - {dashboardStats.topContributors.map((entry, index) => ( - - ))} -
-
+ {/* Leaderboard Section */} + +
+

+ 🏆 Top Contributors Leaderboard +

+

+ Celebrating our most active community members who make RecodHive awesome! +

+
- {/* Call to Action */} - -
-

Want to see your name here?

-

Join our community and start contributing to open source projects!

- + + + {/* Call to Action */} + - Start Contributing - - - Join Community - +
+

Want to see your name here?

+

Join our community and start contributing to open source projects!

+ +
+
-
- + ) : ( +
+

Community Discussions

+

Join the conversation, ask questions, and share your thoughts with the RecodeHive community.

+
+ +
+
+ )} +
); }; -const DashboardWithProvider: React.FC = () => { +const Dashboard: React.FC = () => { return ( - + ); }; -export default DashboardWithProvider; \ No newline at end of file +export default Dashboard; \ No newline at end of file