fix(web): keep auction tier labels inside chart
This commit is contained in:
1 parent
181beb85e5
commit
e9081d77c9
2 files changed
+29
-31
No files matched your search
@@ -179,11 +179,13 @@ export default function TierHistoryChart({
|
|||||||
className = "border border-base-content/10 bg-base-100 mb-5 overflow-hidden",
|
className = "border border-base-content/10 bg-base-100 mb-5 overflow-hidden",
|
||||||
summaryVariant = "footer",
|
summaryVariant = "footer",
|
||||||
height = 220,
|
height = 220,
|
||||||
|
showHeader = true,
|
||||||
}: {
|
}: {
|
||||||
entries: ApiTierHistoryEntry[];
|
entries: ApiTierHistoryEntry[];
|
||||||
className?: string;
|
className?: string;
|
||||||
summaryVariant?: SummaryVariant;
|
summaryVariant?: SummaryVariant;
|
||||||
height?: number;
|
height?: number;
|
||||||
|
showHeader?: boolean;
|
||||||
}) {
|
}) {
|
||||||
// 데이터에 존재하는 큐 목록 (솔로 우선)
|
// 데이터에 존재하는 큐 목록 (솔로 우선)
|
||||||
const availableQueues = useMemo(() => {
|
const availableQueues = useMemo(() => {
|
||||||
@@ -288,7 +290,7 @@ export default function TierHistoryChart({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={className}>
|
<section className={className}>
|
||||||
{header}
|
{showHeader && header}
|
||||||
{points.length < 2 ? (
|
{points.length < 2 ? (
|
||||||
<div className="px-4 py-10 text-center text-xs text-base-content/35">
|
<div className="px-4 py-10 text-center text-xs text-base-content/35">
|
||||||
티어 변동 기록이 아직 부족해요.
|
티어 변동 기록이 아직 부족해요.
|
||||||
@@ -298,27 +300,14 @@ export default function TierHistoryChart({
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="relative px-2 pt-4 pb-1">
|
<div className="relative px-2 pt-4 pb-1">
|
||||||
{summaryVariant === "inline" && summary && (
|
|
||||||
<div
|
|
||||||
className={`pointer-events-none absolute right-3 top-3 z-10 border border-base-content/10 bg-base-100/90 px-2 py-1 text-[10px] font-bold shadow-sm ${
|
|
||||||
summary.direction === "up"
|
|
||||||
? "text-green-500"
|
|
||||||
: summary.direction === "down"
|
|
||||||
? "text-red-400"
|
|
||||||
: "text-base-content/50"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
기간 {formatPeriodChange(summary)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<ResponsiveContainer width="100%" height={height}>
|
<ResponsiveContainer width="100%" height={height}>
|
||||||
<LineChart
|
<LineChart
|
||||||
data={points}
|
data={points}
|
||||||
margin={{
|
margin={{
|
||||||
top: summaryVariant === "inline" ? 26 : 8,
|
top: summaryVariant === "inline" ? 18 : 8,
|
||||||
right: summaryVariant === "inline" ? 48 : 16,
|
right: summaryVariant === "inline" ? 20 : 16,
|
||||||
bottom: 4,
|
bottom: 4,
|
||||||
left: 4,
|
left: summaryVariant === "inline" ? 12 : 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CartesianGrid
|
<CartesianGrid
|
||||||
@@ -369,6 +358,28 @@ export default function TierHistoryChart({
|
|||||||
/>
|
/>
|
||||||
{summaryVariant === "inline" && summary && (
|
{summaryVariant === "inline" && summary && (
|
||||||
<>
|
<>
|
||||||
|
<ReferenceLine
|
||||||
|
y={summary.peak.value}
|
||||||
|
stroke="transparent"
|
||||||
|
label={{
|
||||||
|
value: `최고 ${formatTierLabel(summary.peak)}`,
|
||||||
|
position: "insideLeft",
|
||||||
|
fill: "currentColor",
|
||||||
|
fontSize: 10,
|
||||||
|
className: "text-amber-400",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ReferenceLine
|
||||||
|
y={summary.last.value}
|
||||||
|
stroke="transparent"
|
||||||
|
label={{
|
||||||
|
value: `현재 ${formatTierLabel(summary.last)}`,
|
||||||
|
position: "insideRight",
|
||||||
|
fill: "currentColor",
|
||||||
|
fontSize: 10,
|
||||||
|
className: "text-primary",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<ReferenceDot
|
<ReferenceDot
|
||||||
x={summary.peak.ts}
|
x={summary.peak.ts}
|
||||||
y={summary.peak.value}
|
y={summary.peak.value}
|
||||||
@@ -376,13 +387,6 @@ export default function TierHistoryChart({
|
|||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
className="text-amber-400"
|
className="text-amber-400"
|
||||||
label={{
|
|
||||||
value: `최고 ${formatTierLabel(summary.peak)}`,
|
|
||||||
position: "top",
|
|
||||||
fill: "currentColor",
|
|
||||||
fontSize: 10,
|
|
||||||
className: "text-amber-400",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<ReferenceDot
|
<ReferenceDot
|
||||||
x={summary.last.ts}
|
x={summary.last.ts}
|
||||||
@@ -391,13 +395,6 @@ export default function TierHistoryChart({
|
|||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
className="text-primary"
|
className="text-primary"
|
||||||
label={{
|
|
||||||
value: `현재 ${formatTierLabel(summary.last)}`,
|
|
||||||
position: "right",
|
|
||||||
fill: "currentColor",
|
|
||||||
fontSize: 10,
|
|
||||||
className: "text-primary",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -554,6 +554,7 @@ function PlayerSpotlight({
|
|||||||
className="border-b border-base-content/8 bg-base-100 overflow-hidden"
|
className="border-b border-base-content/8 bg-base-100 overflow-hidden"
|
||||||
summaryVariant="inline"
|
summaryVariant="inline"
|
||||||
height={180}
|
height={180}
|
||||||
|
showHeader={false}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in new issue
Block a user