@@ -34,25 +34,23 @@ export function LeaderboardTable({
3434 < div className = "w-full max-w-4xl flex flex-col gap-4" >
3535 < div className = "bg-white dark:bg-white/5 backdrop-blur-md rounded-2xl border border-slate-200 dark:border-white/10 overflow-hidden shadow-lg dark:shadow-2xl" >
3636 < div className = "overflow-x-auto w-full" >
37- { /* ✅ ВИПРАВЛЕННЯ 1: border-separate + border-spacing-0 замість border-collapse */ }
38- < table className = "w-full min-w-[350px] text-left border-separate border-spacing-0" >
37+ < table className = "w-full text-left border-separate border-spacing-0" >
3938 < caption className = "sr-only" > { t ( 'tableCaption' ) } </ caption >
4039
4140 < thead className = "bg-slate-50/80 dark:bg-white/5" >
4241 < tr >
43- < th className = "px-3 sm:px-6 py-4 sm:py-5 text-center text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-[15%] border-b border-slate-200 dark:border-white/10" >
42+ < th className = "px-2 sm:px-6 py-3 sm:py-5 text-center text-[10px] sm:text- xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-12 sm: w-[15%] border-b border-slate-200 dark:border-white/10" >
4443 { t ( 'rank' ) }
4544 </ th >
46- < th className = "px-3 sm:px-6 py-4 sm:py-5 text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-[60%] border-b border-slate-200 dark:border-white/10" >
45+ < th className = "px-2 sm:px-6 py-3 sm:py-5 text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-auto border-b border-slate-200 dark:border-white/10" >
4746 { t ( 'user' ) }
4847 </ th >
49- < th className = "px-3 sm:px-6 py-4 sm:py-5 text-right text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-[25%] border-b border-slate-200 dark:border-white/10" >
48+ < th className = "px-2 sm:px-6 py-3 sm:py-5 text-right text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest w-[25%] sm:w-[20 %] border-b border-slate-200 dark:border-white/10" >
5049 { t ( 'score' ) }
5150 </ th >
5251 </ tr >
5352 </ thead >
5453
55- { /* ✅ ВИПРАВЛЕННЯ 2: Прибрали divide-y, бо він конфліктує з border-separate */ }
5654 < tbody >
5755 { topUsers . map ( user => {
5856 const isMe =
@@ -81,7 +79,7 @@ export function LeaderboardTable({
8179
8280 < div className = "bg-white dark:bg-white/5 backdrop-blur-md rounded-2xl border-2 border-[var(--accent-primary)] overflow-hidden shadow-[0_0_20px_var(--accent-primary)]" >
8381 < div className = "overflow-x-auto w-full" >
84- < table className = "w-full min-w-[350px] text-left border-separate border-spacing-0" >
82+ < table className = "w-full text-left border-separate border-spacing-0" >
8583 < tbody >
8684 < TableRow user = { matchedUser } isCurrentUser = { true } t = { t } />
8785 </ tbody >
@@ -103,20 +101,23 @@ function TableRow({
103101 isCurrentUser : boolean ;
104102 t : ReturnType < typeof useTranslations > ;
105103} ) {
106- // ✅ ВИПРАВЛЕННЯ 3: Спільний клас для ліній між рядками
107104 const cellClass =
108- 'px-3 sm:px-6 py-4 border-b border-slate-100 dark:border-white/5' ;
105+ 'px-2 sm:px-6 py-3 sm:py-4 border-b border-slate-100 dark:border-white/5' ;
106+
107+ const leftBorderClass = isCurrentUser
108+ ? 'border-l-[1px] sm:border-l-[1px] border-l-[var(--accent-primary)]'
109+ : 'border-l-[1px] sm:border-l-[1px] border-l-transparent' ;
109110
110111 return (
111112 < tr
112113 className = { cn (
113114 'group transition-all duration-300' ,
114115 isCurrentUser
115- ? 'bg-[color-mix(in_srgb,var(--accent-primary),transparent_90%)] border-l-[4px] sm:border-l-[6px] border-l-[var(--accent-primary)] shadow-inner'
116- : 'hover:bg-slate-50 dark:hover:bg-white/5 border-l-[4px] sm:border-l-[6px] border-l-transparent '
116+ ? 'bg-[color-mix(in_srgb,var(--accent-primary),transparent_90%)] shadow-inner'
117+ : 'hover:bg-slate-50/60 dark:hover:bg-white/[0.04] '
117118 ) }
118119 >
119- < td className = { cellClass } >
120+ < td className = { cn ( cellClass , leftBorderClass ) } >
120121 < div className = "flex justify-center items-center" >
121122 < RankBadge rank = { user . rank } />
122123 </ div >
@@ -139,18 +140,18 @@ function TableRow({
139140 < div className = "flex flex-col min-w-0" >
140141 < span
141142 className = { cn (
142- 'font-medium text-sm transition-colors flex items-center gap-2 truncate' ,
143+ 'font-medium text-sm transition-colors flex items-center gap-1 sm:gap- 2 truncate' ,
143144 isCurrentUser
144145 ? 'text-[var(--accent-primary)] font-black text-sm sm:text-base'
145- : 'text-slate-700 dark:text-slate-200 group-hover:text-[var(--accent-primary)]'
146+ : 'text-slate-700 dark:text-slate-200 group-hover:text-[var(--accent-primary)] dark:group-hover:text-[var(--accent-primary)] '
146147 ) }
147148 >
148- < span className = "truncate max-w-[120px ] sm:max-w-none" >
149+ < span className = "truncate max-w-[100px ] sm:max-w-none" >
149150 { user . username }
150151 </ span >
151152
152153 { isCurrentUser && (
153- < div className = "relative flex-shrink-0 flex items-center justify-center w-6 h-6 sm:w-8 sm:h-8 ml-1" >
154+ < div className = "relative flex-shrink-0 flex items-center justify-center w-5 h-5 sm:w-8 sm:h-8 ml-1" >
154155 < motion . div
155156 animate = { { scale : [ 1 , 1.2 , 1 ] } }
156157 transition = { {
@@ -168,10 +169,6 @@ function TableRow({
168169 < path d = "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
169170 </ svg >
170171 </ motion . div >
171-
172- < span className = "relative z-10 text-[6px] sm:text-[8px] font-black text-white uppercase tracking-tighter -mt-0.5" >
173- { t ( 'you' ) || 'YOU' }
174- </ span >
175172 </ div >
176173 ) }
177174 </ span >
@@ -191,8 +188,8 @@ function TableRow({
191188 className = { cn (
192189 'font-mono font-bold inline-block transition-all' ,
193190 isCurrentUser
194- ? 'text-[var(--accent-primary)] scale-110 drop-shadow-sm text-base sm:text-lg'
195- : 'text-slate-700 dark:text-slate-300 group-hover:scale-105'
191+ ? 'text-[var(--accent-primary)] scale-110 drop-shadow-sm text-sm sm:text-lg'
192+ : 'text-slate-700 dark:text-slate-300 group-hover:scale-105 text-sm sm:text-base '
196193 ) }
197194 >
198195 { user . points . toLocaleString ( ) }
@@ -205,32 +202,32 @@ function TableRow({
205202function RankBadge ( { rank } : { rank : number } ) {
206203 if ( rank === 1 ) {
207204 return (
208- < div className = "relative w-10 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-1 sm:gap-1.5 rounded-lg bg-yellow-100 dark:bg-yellow-500/20 border border-yellow-500/50 shadow-[0_0_10px_rgba(234,179,8,0.3)]" >
205+ < div className = "relative w-8 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-0.5 sm:gap-1.5 rounded-md sm: rounded-lg bg-yellow-100 dark:bg-yellow-500/20 border border-yellow-500/50 shadow-[0_0_10px_rgba(234,179,8,0.3)]" >
209206 < span className = "font-black text-xs sm:text-base text-yellow-700 dark:text-yellow-400" >
210207 1
211208 </ span >
212- < Trophy className = "w-3 h-3 sm:w-4 sm:h-4 text-yellow-600 dark:text-yellow-400" />
209+ < Trophy className = "w-2.5 h-2.5 sm:w-4 sm:h-4 text-yellow-600 dark:text-yellow-400" />
213210 < div className = "absolute -top-1 -right-1 w-1.5 h-1.5 sm:w-2 sm:h-2 bg-yellow-400 rounded-full animate-pulse" />
214211 </ div >
215212 ) ;
216213 }
217214 if ( rank === 2 ) {
218215 return (
219- < div className = "w-10 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-1 sm:gap-1.5 rounded-lg bg-slate-100 dark:bg-slate-400/10 border border-slate-300 dark:border-slate-400/30" >
216+ < div className = "w-8 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-0.5 sm:gap-1.5 rounded-md sm: rounded-lg bg-slate-100 dark:bg-slate-400/10 border border-slate-300 dark:border-slate-400/30" >
220217 < span className = "font-black text-xs sm:text-base text-slate-600 dark:text-slate-300" >
221218 2
222219 </ span >
223- < Medal className = "w-3 h-3 sm:w-4 sm:h-4 text-slate-500 dark:text-slate-300" />
220+ < Medal className = "w-2.5 h-2.5 sm:w-4 sm:h-4 text-slate-500 dark:text-slate-300" />
224221 </ div >
225222 ) ;
226223 }
227224 if ( rank === 3 ) {
228225 return (
229- < div className = "w-10 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-1 sm:gap-1.5 rounded-lg bg-orange-50 dark:bg-orange-500/10 border border-orange-300 dark:border-orange-500/30" >
226+ < div className = "w-8 h-6 sm:w-14 sm:h-8 flex items-center justify-center gap-0.5 sm:gap-1.5 rounded-md sm: rounded-lg bg-orange-50 dark:bg-orange-500/10 border border-orange-300 dark:border-orange-500/30" >
230227 < span className = "font-black text-xs sm:text-base text-orange-700 dark:text-orange-400" >
231228 3
232229 </ span >
233- < Medal className = "w-3 h-3 sm:w-4 sm:h-4 text-orange-600 dark:text-orange-400" />
230+ < Medal className = "w-2.5 h-2.5 sm:w-4 sm:h-4 text-orange-600 dark:text-orange-400" />
234231 </ div >
235232 ) ;
236233 }
0 commit comments