Do not show Own team/Opponent label when not in the match

Closes #3044
This commit is contained in:
Kalle
2026-05-09 13:25:53 +03:00
parent 6bf6147078
commit 521a3add7c
3 changed files with 9 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ export function MatchActionTab({
<TeamRadioOption
team={teams[0]}
isOwnTeam={teams[0].id === ownTeamId}
hideLabel={ownTeamId == null}
hideLabel={ownTeamId === null}
className={styles.alpha}
testId="winner-radio-1"
/>

View File

@@ -21,7 +21,7 @@ export function TournamentMatchActionTab({
ownTeamId,
}: {
data: TournamentMatchLoaderData;
ownTeamId: number;
ownTeamId: number | null;
}) {
const { t } = useTranslation(["q"]);
const tournament = useTournament();

View File

@@ -62,7 +62,12 @@ export function TournamentMatchTabs({
const opponentTwoId = teamTwo.id;
const pickBanTeams: [MatchPageTeam, MatchPageTeam] = [teamOne, teamTwo];
const userTeamId = tournament.teamMemberOfByUser(user)?.id;
const userTournamentTeamId = tournament.teamMemberOfByUser(user)?.id;
const userTeamId =
userTournamentTeamId === opponentOneId ||
userTournamentTeamId === opponentTwoId
? userTournamentTeamId
: null;
const pickBanData = resolveTimelinePickBanData(
data,
@@ -102,10 +107,7 @@ export function TournamentMatchTabs({
turnOfResult={turnOfResult}
/>
) : (
<TournamentMatchActionTab
data={data}
ownTeamId={userTeamId ?? opponentOneId}
/>
<TournamentMatchActionTab data={data} ownTeamId={userTeamId} />
)
) : null}
{tabs.includes(TAB_KEYS.ADMIN) ? (