Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ module.exports = {
singleQuote: true,
trailingComma: "es5",
tabWidth: 2,
importOrder: ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")]
plugins: ["prettier-plugin-organize-imports"]
};
2 changes: 1 addition & 1 deletion frontend/openapi-ts.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@hey-api/openapi-ts';
import {defineConfig} from '@hey-api/openapi-ts';

export default defineConfig({
input: '../backend/openapi/openapi.json',
Expand Down
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@
"dayjs": "1.11.10",
"i18next": "25.7.1",
"nuqs": "2.8.0",
"prettier-plugin-organize-imports": "^4.3.0",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-i18next": "16.5.0",
"react-icons": "5.5.0",
"react-qr-code": "2.0.12",
"react-router": "7.11.0",
"swr": "2.3.0"
"swr": "2.3.0",
"vite-tsconfig-paths": "^6.0.3"
},
"devDependencies": {
"@hey-api/openapi-ts": "0.89.2",
"@trivago/prettier-plugin-sort-imports": "6.0.0",
"@types/node": "25.0.0",
"@types/react": "19.2.4",
"@types/react-dom": "19.2.3",
Expand Down
117 changes: 59 additions & 58 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 23 additions & 16 deletions frontend/src/components/brackets/brackets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ import { useTranslation } from 'react-i18next';
import { MdOutlineAutoFixHigh } from 'react-icons/md';
import { SWRResponse } from 'swr';

import { BracketDisplaySettings } from '../../interfaces/brackets';
import { Round } from '../../interfaces/round';
import { StageItemWithRounds } from '../../interfaces/stage_item';
import { TournamentMinimal } from '../../interfaces/tournament';
import { Tournament } from '../../openapi';
import { createRound } from '../../services/round';
import ActivateNextRoundModal from '../modals/activate_next_round_modal';
import { NoContent } from '../no_content/empty_table_info';
import { Translator } from '../utils/types';
import { responseIsValid } from '../utils/util';
import ActivateNextRoundModal from '@components/modals/activate_next_round_modal';
import { NoContent } from '@components/no_content/empty_table_info';
import { BracketDisplaySettings } from '@components/utils/brackets';
import { TournamentMinimal } from '@components/utils/tournament';
import { Translator } from '@components/utils/types';
import { responseIsValid } from '@components/utils/util';
import {
RoundWithMatches,
StageItemWithRounds,
StagesWithStageItemsResponse,
Tournament,
UpcomingMatchesResponse,
} from '@openapi';
import { createRound } from '@services/round';
import RoundComponent from './round';

function AddRoundButton({
Expand All @@ -40,8 +44,8 @@ function AddRoundButton({
t: Translator;
tournamentData: TournamentMinimal;
stageItem: StageItemWithRounds;
swrStagesResponse: SWRResponse;
swrUpcomingMatchesResponse: SWRResponse;
swrStagesResponse: SWRResponse<StagesWithStageItemsResponse>;
swrUpcomingMatchesResponse: SWRResponse<UpcomingMatchesResponse>;
size: 'md' | 'lg';
}) {
return (
Expand Down Expand Up @@ -71,8 +75,8 @@ export function RoundsGridCols({
}: {
stageItem: StageItemWithRounds;
tournamentData: Tournament;
swrStagesResponse: SWRResponse;
swrUpcomingMatchesResponse: SWRResponse;
swrStagesResponse: SWRResponse<StagesWithStageItemsResponse>;
swrUpcomingMatchesResponse: SWRResponse<UpcomingMatchesResponse>;
readOnly: boolean;
displaySettings: BracketDisplaySettings;
}) {
Expand All @@ -87,8 +91,11 @@ export function RoundsGridCols({

let result: React.JSX.Element[] | React.JSX.Element = stageItem.rounds
.sort((r1: any, r2: any) => (r1.name > r2.name ? 1 : -1))
.filter((round: Round) => round.matches.length > 0 || displaySettings.matchVisibility === 'all')
.map((round: Round) => (
.filter(
(round: RoundWithMatches) =>
round.matches.length > 0 || displaySettings.matchVisibility === 'all'
)
.map((round: RoundWithMatches) => (
<RoundComponent
key={round.id}
tournamentData={tournamentData}
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/components/brackets/courts.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Grid, Title } from '@mantine/core';
import React from 'react';
import { SWRResponse } from 'swr';

import { Round } from '../../interfaces/round';
import { TournamentMinimal } from '../../interfaces/tournament';
import { getStages } from '../../services/adapter';
import { TournamentMinimal } from '@components/utils/tournament';
import { RoundWithMatches } from '@openapi';
import { getStages } from '@services/adapter';
import Match from './match';

function getRoundsGridCols(
swrStagesResponse: SWRResponse,
activeRound: Round,
activeRound: RoundWithMatches,
tournamentData: TournamentMinimal
) {
return activeRound.matches
Expand All @@ -36,7 +35,7 @@ export default function Courts({
activeRound,
}: {
tournamentData: TournamentMinimal;
activeRound: Round;
activeRound: RoundWithMatches;
}) {
const swrStagesResponse = getStages(tournamentData.id);
return (
Expand Down
Loading