@@ -7,6 +7,7 @@ import NavbarIcon from "../../../components/navbar/NavbarIcon";
77import { useHistory } from "@docusaurus/router" ;
88import { Home , MessageCircle , Gift , Trophy , Crown , Star , Award , Clock , Users , TrendingUp , Medal , ArrowLeft } from "lucide-react" ;
99import "../dashboard.css" ;
10+ import { add } from "date-fns" ;
1011
1112// Giveaway-specific styles
1213const giveawayStyles = `
@@ -421,7 +422,8 @@ const giveawayStyles = `
421422}
422423` ;
423424
424- // Inject styles
425+
426+
425427if ( typeof document !== 'undefined' ) {
426428 const existingStyle = document . getElementById ( 'giveaway-styles' ) ;
427429 if ( ! existingStyle ) {
@@ -449,7 +451,7 @@ const GiveawayPage: React.FC = () => {
449451 const [ loading , setLoading ] = useState ( true ) ;
450452 const [ activeTab , setActiveTab ] = useState < "home" | "discuss" | "contributors" | "giveaway" > ( "giveaway" ) ;
451453
452- // Close dashboard menu when clicking outside
454+
453455 useEffect ( ( ) => {
454456 const handleClickOutside = ( event : MouseEvent ) => {
455457 const target = event . target as Element ;
@@ -466,18 +468,25 @@ const GiveawayPage: React.FC = () => {
466468 document . addEventListener ( 'mousedown' , handleClickOutside ) ;
467469 }
468470
471+
469472 return ( ) => {
473+
474+
475+
476+
477+
470478 document . removeEventListener ( 'mousedown' , handleClickOutside ) ;
471479 } ;
472480 } , [ showDashboardMenu ] ) ;
473481
474- // Ensure active tab is set correctly when page loads
475482 useEffect ( ( ) => {
476- // We're on the giveaway page, so the active tab should be "giveaway"
477483 setActiveTab ( "giveaway" ) ;
478484 } , [ ] ) ;
479485
480486 useEffect ( ( ) => {
487+
488+
489+
481490 // Simulate fetching leaderboard data
482491 const fetchLeaderboard = async ( ) => {
483492 setLoading ( true ) ;
@@ -578,36 +587,37 @@ const GiveawayPage: React.FC = () => {
578587 < Head >
579588 < title > 🎁 recode hive Giveaway</ title >
580589 </ Head >
581- < div className = "dashboard-layout" >
582- { /* Dashboard Menu Button - Only visible on mobile */ }
583- < button
590+ < div className = "dashboard-layout" >
591+ < button
584592 className = { `dashboard-menu-btn ${ showDashboardMenu ? "open" : "" } ` }
585593 onClick = { ( ) => setShowDashboardMenu ( ! showDashboardMenu ) }
586594 aria-label = "Toggle dashboard menu"
587595 >
588596 { showDashboardMenu ? < span aria-hidden = "true" > ✕</ span > : < span aria-hidden = "true" > ☰</ span > }
589597 </ button >
590-
591- { /* Dashboard Mobile Menu */ }
598+
592599 < div className = { `dashboard-mobile-menu ${ showDashboardMenu ? "show" : "" } ` } >
593- { /* Overlay - always present but opacity controlled by CSS */ }
594600 < div
595601 className = "dashboard-menu-overlay"
596- onClick = { ( ) => setShowDashboardMenu ( false ) }
597- />
602+ onClick = { ( ) => setShowDashboardMenu ( false ) } />
598603 < div >
599604 < div className = "dashboard-menu-header" >
600- < h3 > Dashboard Menu</ h3 >
601- < button
602- className = "close-menu-btn"
603- onClick = { ( ) => setShowDashboardMenu ( false ) }
604- aria-label = "Close menu"
605- >
606- ✕
607- </ button >
608- </ div >
605+ { /* <h3>Dashboard Menu</h3> */ }
606+
607+ </ div >
608+
609+ < div className = "dashboard-menu-header" >
610+ < h3 > Dashboard Menu</ h3 >
611+ < button
612+ className = "close-menu-btn"
613+ onClick = { ( ) => setShowDashboardMenu ( false ) }
614+ aria-label = "Close menu"
615+ >
616+ ✕
617+ </ button >
618+ </ div >
619+
609620
610- { /* Dashboard navigation items */ }
611621 < div className = "dashboard-menu-items" >
612622 < div
613623 className = { `menu-item ${ activeTab === "home" ? "active" : "" } ` }
@@ -647,7 +657,11 @@ const GiveawayPage: React.FC = () => {
647657 </ div >
648658 </ div >
649659 </ div >
650- </ div >
660+ </ div >
661+
662+
663+
664+
651665
652666 < div className = "dashboard-sidebar" >
653667 < div className = "sidebar-header" >
0 commit comments