.
This commit is contained in:
1 parent
2472f865ad
commit
c82bf55fe9
3 files changed
+31
-9
No files matched your search
@@ -221,10 +221,15 @@ export interface MatchesResponse {
|
||||
matches: ApiMatch[];
|
||||
}
|
||||
|
||||
export interface DdragonChampionEntry {
|
||||
key: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface DdragonManifest {
|
||||
version: string;
|
||||
cdn: string;
|
||||
locale: string;
|
||||
champions: Record<string, string>;
|
||||
champions: Record<string, DdragonChampionEntry>;
|
||||
fetchedAt: string;
|
||||
}
|
||||
@@ -14,7 +14,11 @@ import {
|
||||
useDevCaptainSide,
|
||||
} from '../config';
|
||||
import { ApiError } from '../lib/api';
|
||||
import { championIconUrl, profileIconUrl } from '../lib/ddragon';
|
||||
import {
|
||||
championDisplayName,
|
||||
championIconUrl,
|
||||
profileIconUrl,
|
||||
} from '../lib/ddragon';
|
||||
import { positionIcon, positionLabel } from '../lib/league';
|
||||
import type { Position } from '../api/types';
|
||||
|
||||
@@ -195,13 +199,16 @@ function PlayerSpotlight({
|
||||
{player.masteries.length > 0 ? (
|
||||
player.masteries.map((mastery) => {
|
||||
const iconUrl = championIconUrl(ddragon, mastery.championId);
|
||||
const displayName =
|
||||
championDisplayName(ddragon, mastery.championId) ??
|
||||
mastery.championName;
|
||||
return (
|
||||
<div key={mastery.championId} className="flex items-center gap-2">
|
||||
<div className="w-7 h-7 bg-base-content/10 overflow-hidden shrink-0">
|
||||
{iconUrl ? (
|
||||
<img
|
||||
src={iconUrl}
|
||||
alt={mastery.championName}
|
||||
alt={displayName}
|
||||
className="w-full h-full object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
@@ -209,7 +216,7 @@ function PlayerSpotlight({
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="text-[12px] font-medium text-base-content truncate">
|
||||
{mastery.championName}
|
||||
{displayName}
|
||||
</div>
|
||||
<div className="text-[10px] text-base-content/25">
|
||||
Lv.{mastery.level} · {(mastery.points / 1000).toFixed(0)}K
|
||||
|
||||
Reference in new issue
Block a user