Merge pull request 'Правка отображение идущих игр в группе (#26)' (#27) from issue-26-drop-live-badge into dev
Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
@@ -29,10 +29,7 @@ export function InProgressMatches({
|
||||
style={{ margin: 0, width: "100%", textAlign: "left" }}
|
||||
>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
{showGroupName && <b>{m.group_name}</b>}
|
||||
<span className="badge badge-live">идёт</span>
|
||||
</div>
|
||||
{showGroupName && <b>{m.group_name}</b>}
|
||||
<div className="muted small">
|
||||
{formatTime(m.started_at)} · {m.player_count}{" "}
|
||||
{plural(m.player_count, "игрок", "игрока", "игроков")}
|
||||
|
||||
@@ -4,6 +4,9 @@ import { formatDate, formatDuration } from "../domain/format";
|
||||
import { winReasonLabel } from "../domain/winReasons";
|
||||
import type { MatchListItem } from "../domain/types";
|
||||
|
||||
/** Список ЗАВЕРШЁННЫХ партий. Незавершённые сюда не попадают: группа отдаёт их
|
||||
* отдельным блоком (InProgressMatches), а история профиля приходит с бэкенда уже
|
||||
* отфильтрованной по status="finished". */
|
||||
export function MatchListView({ items }: { items: MatchListItem[] }) {
|
||||
const navigate = useNavigate();
|
||||
if (items.length === 0) return <div className="muted small">Партий пока нет.</div>;
|
||||
@@ -11,7 +14,6 @@ export function MatchListView({ items }: { items: MatchListItem[] }) {
|
||||
return (
|
||||
<div className="stack">
|
||||
{items.map((m) => {
|
||||
const inProgress = m.status === "in_progress";
|
||||
const sorted = [...m.participants].sort((a, b) => (a.place ?? 99) - (b.place ?? 99));
|
||||
return (
|
||||
<button
|
||||
@@ -22,13 +24,9 @@ export function MatchListView({ items }: { items: MatchListItem[] }) {
|
||||
>
|
||||
<div className="row-between">
|
||||
<span className="muted small">{formatDate(m.played_at)}</span>
|
||||
{inProgress ? (
|
||||
<span className="badge badge-live">идёт</span>
|
||||
) : (
|
||||
<span className="muted small">
|
||||
{formatDuration(m.duration_minutes)} · {winReasonLabel(m.win_reason)}
|
||||
</span>
|
||||
)}
|
||||
<span className="muted small">
|
||||
{formatDuration(m.duration_minutes)} · {winReasonLabel(m.win_reason)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="stack" style={{ marginTop: 6, gap: 4 }}>
|
||||
{/* Ники здесь — просто текст: карточка целиком ведёт в партию,
|
||||
|
||||
Reference in New Issue
Block a user