feat: add spell and rune tooltips
This commit is contained in:
1 parent
4906f665fd
commit
292e37aaac
8 files changed
+404
-161
No files matched your search
@@ -3,12 +3,10 @@ import type { ApiInternalMatchDetailResponse, DdragonManifest, TeamSide } from "
|
||||
import {
|
||||
championDisplayName,
|
||||
championIconUrl,
|
||||
runeIconUrl,
|
||||
runeStyleIconUrl,
|
||||
} from "../lib/ddragon";
|
||||
import { teamIndexLabel } from "../lib/league";
|
||||
import { LANE_LABELS } from "../lib/riot-history";
|
||||
import { ItemIcon } from "./ItemTooltip";
|
||||
import { ItemIcon, RuneIcon, RuneStyleIcon } from "./ItemTooltip";
|
||||
|
||||
export type InternalGameDetailTab = "scoreboard" | "matchup" | "build";
|
||||
|
||||
@@ -413,21 +411,17 @@ function RuneTreeColumn({
|
||||
);
|
||||
}
|
||||
|
||||
const styleIcon = runeStyleIconUrl(manifest, runeStyle.id);
|
||||
const selectionIds = new Set(selection?.perkIds ?? []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="h-6 w-6 overflow-hidden bg-base-content/10">
|
||||
{styleIcon ? (
|
||||
<img
|
||||
src={styleIcon}
|
||||
alt=""
|
||||
className="h-full w-full object-cover"
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
<RuneStyleIcon
|
||||
styleId={runeStyle.id}
|
||||
manifest={manifest}
|
||||
className="h-6 w-6"
|
||||
slotClassName="bg-base-content/10"
|
||||
/>
|
||||
<div className="min-w-0">
|
||||
<div className="text-[10px] font-bold uppercase tracking-wider text-base-content/35">
|
||||
{label}
|
||||
@@ -455,25 +449,18 @@ function RuneTreeColumn({
|
||||
{slot.runes.map((rune) => {
|
||||
const selected =
|
||||
selectedIds.has(rune.id) || selectionIds.has(rune.id);
|
||||
const icon = runeIconUrl(manifest, rune.id);
|
||||
return (
|
||||
<span
|
||||
<RuneIcon
|
||||
key={rune.id}
|
||||
title={rune.name}
|
||||
className={`${iconSize} overflow-hidden border bg-base-content/10 transition ${
|
||||
runeId={rune.id}
|
||||
manifest={manifest}
|
||||
className={iconSize}
|
||||
slotClassName={`border bg-base-content/10 transition ${
|
||||
selected
|
||||
? "border-transparent opacity-100 ring-1 ring-primary/60"
|
||||
: "border-transparent opacity-20 grayscale"
|
||||
}`}
|
||||
>
|
||||
{icon ? (
|
||||
<img
|
||||
src={icon}
|
||||
alt=""
|
||||
className="h-full w-full object-cover"
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user