@@ -66,7 +66,7 @@ const parseCSVToJSON = (csvText: string): any[] => {
66
66
const DashboardContent : React . FC = ( ) => {
67
67
const location = useLocation ( ) ;
68
68
const history = useHistory ( ) ;
69
- const [ activeTab , setActiveTab ] = useState < 'home' | 'discuss' | 'leaderboard' > ( 'home' ) ;
69
+ const [ activeTab , setActiveTab ] = useState < 'home' | 'discuss' | 'leaderboard' | 'giveaway' > ( 'home' ) ;
70
70
const [ isSidebarCollapsed , setIsSidebarCollapsed ] = useState ( false ) ;
71
71
const [ leaderboardData , setLeaderboardData ] = useState < LeaderboardEntry [ ] > ( [ ] ) ;
72
72
const [ isLoadingLeaderboard , setIsLoadingLeaderboard ] = useState ( false ) ;
@@ -78,7 +78,10 @@ const DashboardContent: React.FC = () => {
78
78
setActiveTab ( 'discuss' ) ;
79
79
} else if ( location . hash === '#leaderboard' ) {
80
80
setActiveTab ( 'leaderboard' ) ;
81
- } else {
81
+ } else if ( location . hash === '#giveaway' ) {
82
+ setActiveTab ( 'giveaway' ) ;
83
+ }
84
+ else {
82
85
setActiveTab ( 'home' ) ;
83
86
}
84
87
} , [ location ] ) ;
@@ -220,15 +223,19 @@ const DashboardContent: React.FC = () => {
220
223
return achievements . slice ( 0 , 3 ) ; // Limit to 3 achievements for UI
221
224
} ;
222
225
223
- const handleTabChange = ( tab : 'home' | 'discuss' | 'leaderboard' ) => {
226
+ const handleTabChange = ( tab : 'home' | 'discuss' | 'leaderboard' | 'giveaway' ) => {
224
227
setActiveTab ( tab ) ;
225
228
if ( tab === 'discuss' ) {
226
229
history . push ( '#discuss' ) ;
227
230
window . scrollTo ( 0 , 0 ) ;
228
231
} else if ( tab === 'leaderboard' ) {
229
232
history . push ( '#leaderboard' ) ;
230
233
window . scrollTo ( 0 , 0 ) ;
231
- } else {
234
+ } else if ( tab === 'giveaway' ) {
235
+ history . push ( '/dashboard/giveaway' ) ;
236
+ window . scrollTo ( 0 , 0 ) ;
237
+ }
238
+ else {
232
239
history . push ( '#' ) ;
233
240
}
234
241
} ;
@@ -440,6 +447,16 @@ const DashboardContent: React.FC = () => {
440
447
< span className = "nav-icon" > 🏆</ span >
441
448
< span className = "nav-text" > Leaderboard</ span >
442
449
</ 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
+
443
460
</ ul >
444
461
< div className = "sidebar-footer" >
445
462
< button
@@ -594,7 +611,7 @@ const DashboardContent: React.FC = () => {
594
611
/>
595
612
</ div >
596
613
</ div >
597
- ) : (
614
+ ) : activeTab === 'leaderboard' ? (
598
615
/* Leaderboard Tab */
599
616
< div className = "leaderboard-page-container" >
600
617
< motion . div
@@ -775,6 +792,59 @@ const DashboardContent: React.FC = () => {
775
792
</ motion . div >
776
793
) }
777
794
</ 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
+
778
848
) }
779
849
</ main >
780
850
</ div >
0 commit comments