fix: Constrain rank icon size and table row height
- Set Rating column table cells to fixed height (h-12 = 48px) - Wrap icons in flex container for vertical centering - Reduce icon size from 14x14 to 11x11 to fit within row height - Add max-h-11 constraint to prevent overflow - Add inline-block and align-middle to icon for proper alignment This ensures all table rows remain the same height regardless of whether they show rank icons or Premier rating badges. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const sizeClasses = {
|
const sizeClasses = {
|
||||||
sm: 'h-14 w-14',
|
sm: 'h-11 w-11 max-h-11',
|
||||||
md: 'h-16 w-16',
|
md: 'h-16 w-16',
|
||||||
lg: 'h-20 w-20'
|
lg: 'h-20 w-20'
|
||||||
};
|
};
|
||||||
@@ -61,9 +61,14 @@
|
|||||||
|
|
||||||
{#if showLabel}
|
{#if showLabel}
|
||||||
<div class="inline-flex items-center gap-2 {className}">
|
<div class="inline-flex items-center gap-2 {className}">
|
||||||
<img src={iconPath} alt={rankName} class={sizeClasses[size]} />
|
<img src={iconPath} alt={rankName} class="{sizeClasses[size]} object-contain" />
|
||||||
<span class="font-medium {labelSizeClasses[size]}">{rankName}</span>
|
<span class="font-medium {labelSizeClasses[size]}">{rankName}</span>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<img src={iconPath} alt={rankName} title={rankName} class={`${sizeClasses[size]} ${className}`} />
|
<img
|
||||||
|
src={iconPath}
|
||||||
|
alt={rankName}
|
||||||
|
title={rankName}
|
||||||
|
class="{sizeClasses[size]} {className} inline-block object-contain align-middle"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -162,7 +162,8 @@
|
|||||||
<td class="font-mono">{(player.adr || 0).toFixed(1)}</td>
|
<td class="font-mono">{(player.adr || 0).toFixed(1)}</td>
|
||||||
<td class="font-mono">{(player.hs_percent || 0).toFixed(1)}%</td>
|
<td class="font-mono">{(player.hs_percent || 0).toFixed(1)}%</td>
|
||||||
<td class="font-mono">{player.kast?.toFixed(1) || '0.0'}%</td>
|
<td class="font-mono">{player.kast?.toFixed(1) || '0.0'}%</td>
|
||||||
<td>
|
<td class="h-12">
|
||||||
|
<div class="flex h-full items-center">
|
||||||
<PremierRatingBadge
|
<PremierRatingBadge
|
||||||
rating={player.rank_new}
|
rating={player.rank_new}
|
||||||
oldRating={player.rank_old}
|
oldRating={player.rank_old}
|
||||||
@@ -170,6 +171,7 @@
|
|||||||
showChange={true}
|
showChange={true}
|
||||||
showIcon={false}
|
showIcon={false}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -217,7 +219,8 @@
|
|||||||
<td class="font-mono">{(player.adr || 0).toFixed(1)}</td>
|
<td class="font-mono">{(player.adr || 0).toFixed(1)}</td>
|
||||||
<td class="font-mono">{(player.hs_percent || 0).toFixed(1)}%</td>
|
<td class="font-mono">{(player.hs_percent || 0).toFixed(1)}%</td>
|
||||||
<td class="font-mono">{player.kast?.toFixed(1) || '0.0'}%</td>
|
<td class="font-mono">{player.kast?.toFixed(1) || '0.0'}%</td>
|
||||||
<td>
|
<td class="h-12">
|
||||||
|
<div class="flex h-full items-center">
|
||||||
<PremierRatingBadge
|
<PremierRatingBadge
|
||||||
rating={player.rank_new}
|
rating={player.rank_new}
|
||||||
oldRating={player.rank_old}
|
oldRating={player.rank_old}
|
||||||
@@ -225,6 +228,7 @@
|
|||||||
showChange={true}
|
showChange={true}
|
||||||
showIcon={false}
|
showIcon={false}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
Reference in New Issue
Block a user