Изменить отображение текущей игры во вкладке группы (#2) #19
@@ -4,7 +4,16 @@ import { useNavigate } from "react-router-dom";
|
||||
import { formatTime, plural } from "../domain/format";
|
||||
import type { HomeInProgressMatch } from "../domain/types";
|
||||
|
||||
export function InProgressMatches({ items }: { items: HomeInProgressMatch[] }) {
|
||||
/** Блок незавершённых партий. На главной партии приходят из разных групп, поэтому
|
||||
* название группы нужно; на странице самой группы оно дублирует заголовок — там
|
||||
* блок вызывается с showGroupName={false}. */
|
||||
export function InProgressMatches({
|
||||
items,
|
||||
showGroupName = true,
|
||||
}: {
|
||||
items: HomeInProgressMatch[];
|
||||
showGroupName?: boolean;
|
||||
}) {
|
||||
const navigate = useNavigate();
|
||||
if (items.length === 0) return null;
|
||||
|
||||
@@ -21,7 +30,7 @@ export function InProgressMatches({ items }: { items: HomeInProgressMatch[] }) {
|
||||
>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<b>{m.group_name}</b>
|
||||
{showGroupName && <b>{m.group_name}</b>}
|
||||
<span className="badge badge-live">идёт</span>
|
||||
</div>
|
||||
<div className="muted small">
|
||||
|
||||
@@ -161,7 +161,8 @@ export function GroupPage() {
|
||||
|
||||
<GroupSwitcher />
|
||||
|
||||
<InProgressMatches items={inProgress} />
|
||||
{/* Название группы не показываем: оно уже есть в заголовке страницы. */}
|
||||
<InProgressMatches items={inProgress} showGroupName={false} />
|
||||
|
||||
<h3 style={{ marginTop: 8 }}>Партии</h3>
|
||||
{matches && <MatchListView items={finishedMatches} />}
|
||||
|
||||
Reference in New Issue
Block a user