新增歷史戰績關閉按鈕並更新 README

This commit is contained in:
2026-04-16 15:23:09 +08:00
parent f50b11600e
commit af7ebda9f4
3 changed files with 55 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ export function HistoryPage() {
const handleDelete = async (item: HistoryListItem) => {
const confirmed = window.confirm(
`確定要刪除筆戰績嗎?\n${item.leftTeamName} vs ${item.rightTeamName}`,
`確定要刪除筆戰績嗎?\n${item.leftTeamName} vs ${item.rightTeamName}`,
)
if (!confirmed) {
@@ -74,7 +74,7 @@ export function HistoryPage() {
<p className="panel-kicker">History</p>
<h2></h2>
<p className="panel-copy">
`history`
`history`
</p>
</article>
@@ -82,7 +82,7 @@ export function HistoryPage() {
{loading ? (
<div className="empty-state">
<h3></h3>
<p></p>
<p></p>
</div>
) : error ? (
<div className="empty-state">
@@ -91,8 +91,8 @@ export function HistoryPage() {
</div>
) : history.length === 0 ? (
<div className="empty-state">
<h3></h3>
<p> `history` </p>
<h3></h3>
<p> `history` </p>
</div>
) : (
<div className="history-list">
@@ -112,7 +112,7 @@ export function HistoryPage() {
{item.leftTeamName} vs {item.rightTeamName}
</h3>
</div>
<span className="winner-badge">{item.winnerTeamName}</span>
<span className="winner-badge">{item.winnerTeamName}</span>
</div>
<div className="history-meta">
@@ -120,7 +120,7 @@ export function HistoryPage() {
{item.score[0]} - {item.score[1]}
</span>
<span>{item.typeLabel}</span>
<span>{item.winScore}</span>
<span>{item.winScore}</span>
</div>
</button>
@@ -160,6 +160,15 @@ function HistoryReplayModal({ item, onClose }: HistoryReplayModalProps) {
role="dialog"
onClick={(event) => event.stopPropagation()}
>
<button
aria-label="關閉戰績紀錄"
className="history-modal-close"
type="button"
onClick={onClose}
>
×
</button>
<p className="panel-kicker"></p>
<h3>
{item.leftTeamName} vs {item.rightTeamName}
@@ -180,12 +189,12 @@ function HistoryReplayModal({ item, onClose }: HistoryReplayModalProps) {
<div className="history-modal-summary">
<span>{item.playedAt}</span>
<span>{item.typeLabel}</span>
<span>{item.winnerTeamName}</span>
<span>{item.winnerTeamName}</span>
</div>
<div className="history-replay-list">
{item.scoreList.length === 0 ? (
<p className="history-replay-empty"></p>
<p className="history-replay-empty"></p>
) : (
item.scoreList.map(([round, starter, winCount, winner]) => (
<div className="history-replay-row" key={`${item.id}-${round}`}>