@@ -66,7 +66,7 @@ const parseCSVToJSON = (csvText: string): any[] => {
6666const DashboardContent : React . FC = ( ) => {
6767 const location = useLocation ( ) ;
6868 const history = useHistory ( ) ;
69- const [ activeTab , setActiveTab ] = useState < 'home' | 'discuss' | 'leaderboard' > ( 'home' ) ;
69+ const [ activeTab , setActiveTab ] = useState < 'home' | 'discuss' | 'leaderboard' | 'giveaway' > ( 'home' ) ;
7070 const [ isSidebarCollapsed , setIsSidebarCollapsed ] = useState ( false ) ;
7171 const [ leaderboardData , setLeaderboardData ] = useState < LeaderboardEntry [ ] > ( [ ] ) ;
7272 const [ isLoadingLeaderboard , setIsLoadingLeaderboard ] = useState ( false ) ;
@@ -78,7 +78,10 @@ const DashboardContent: React.FC = () => {
7878 setActiveTab ( 'discuss' ) ;
7979 } else if ( location . hash === '#leaderboard' ) {
8080 setActiveTab ( 'leaderboard' ) ;
81- } else {
81+ } else if ( location . hash === '#giveaway' ) {
82+ setActiveTab ( 'giveaway' ) ;
83+ }
84+ else {
8285 setActiveTab ( 'home' ) ;
8386 }
8487 } , [ location ] ) ;
@@ -220,15 +223,19 @@ const DashboardContent: React.FC = () => {
220223 return achievements . slice ( 0 , 3 ) ; // Limit to 3 achievements for UI
221224 } ;
222225
223- const handleTabChange = ( tab : 'home' | 'discuss' | 'leaderboard' ) => {
226+ const handleTabChange = ( tab : 'home' | 'discuss' | 'leaderboard' | 'giveaway' ) => {
224227 setActiveTab ( tab ) ;
225228 if ( tab === 'discuss' ) {
226229 history . push ( '#discuss' ) ;
227230 window . scrollTo ( 0 , 0 ) ;
228231 } else if ( tab === 'leaderboard' ) {
229232 history . push ( '#leaderboard' ) ;
230233 window . scrollTo ( 0 , 0 ) ;
231- } else {
234+ } else if ( tab === 'giveaway' ) {
235+ history . push ( '/dashboard/giveaway' ) ;
236+ window . scrollTo ( 0 , 0 ) ;
237+ }
238+ else {
232239 history . push ( '#' ) ;
233240 }
234241 } ;
@@ -440,6 +447,16 @@ const DashboardContent: React.FC = () => {
440447 < span className = "nav-icon" > 🏆</ span >
441448 < span className = "nav-text" > Leaderboard</ span >
442449 </ li >
450+
451+ < li
452+ className = { `nav-item ${ activeTab === 'giveaway' ? 'active' : '' } ` }
453+ onClick = { ( ) => handleTabChange
454+ ( 'giveaway' ) }
455+ >
456+ < span className = "nav-icon" > 🎁</ span >
457+ < span className = "nav-text" > Giveaway</ span >
458+ </ li >
459+
443460 </ ul >
444461 < div className = "sidebar-footer" >
445462 < button
@@ -594,7 +611,7 @@ const DashboardContent: React.FC = () => {
594611 />
595612 </ div >
596613 </ div >
597- ) : (
614+ ) : activeTab === 'leaderboard' ? (
598615 /* Leaderboard Tab */
599616 < div className = "leaderboard-page-container" >
600617 < motion . div
@@ -775,6 +792,59 @@ const DashboardContent: React.FC = () => {
775792 </ motion . div >
776793 ) }
777794 </ div >
795+ ) : activeTab === 'giveaway' && (
796+ // ✅ Giveaway Section 🎁
797+ < >
798+ < motion . section className = "dashboard-hero" initial = { { opacity : 0 , y : 10 } } animate = { { opacity : 1 , y : 0 } } transition = { { duration : 0.8 } } >
799+ < div className = "hero-content" >
800+ < h1 className = "dashboard-title" >
801+ 🎁 < span className = "highlight" > Giveaway</ span >
802+ </ h1 >
803+ < p className = "dashboard-subtitle" > Participate in exclusive giveaways and win exciting prizes!</ p >
804+ </ div >
805+ </ motion . section >
806+
807+ { /* 🎉 Giveaway Stats Grid */ }
808+ < motion . section
809+ className = "dashboard-stats-section"
810+ initial = { { opacity : 0 , y : 10 } }
811+ whileInView = { { opacity : 1 } }
812+ transition = { { duration : 0.6 } }
813+ viewport = { { once : true } }
814+ >
815+ < div className = "dashboard-stats-grid" >
816+ < StatCard
817+ icon = "⏳"
818+ title = "Next Giveaway"
819+ value = "5 Days"
820+ valueText = "5 Days Left"
821+ description = "Time remaining"
822+ />
823+ < StatCard
824+ icon = "🎫"
825+ title = "Entries"
826+ value = "1420"
827+ valueText = "1,420"
828+ description = "Total participants"
829+ />
830+ < StatCard
831+ icon = "📈"
832+ title = "Your Rank"
833+ value = "32"
834+ valueText = "Rank 32"
835+ description = "Based on your contribution"
836+ />
837+ < StatCard
838+ icon = "🏅"
839+ title = "Total Winners"
840+ value = "10"
841+ valueText = "10 Winners"
842+ description = "Winners per giveaway"
843+ />
844+ </ div >
845+ </ motion . section >
846+ </ >
847+
778848 ) }
779849 </ main >
780850 </ div >
0 commit comments