Skip to content

Commit 332c794

Browse files
committed
prettier
1 parent 1033b58 commit 332c794

30 files changed

+334
-331
lines changed

frontend/app/auth/callback/[provider]/callbackHandler.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function OAuthCallbackHandler({ provider }: { provider: string }) {
4949

5050
// Clean up session storage and processing ref on error
5151
sessionStorage.removeItem(
52-
OAUTH_CONFIG.SESSION_STORAGE_KEYS.PROCESSED_CODE
52+
OAUTH_CONFIG.SESSION_STORAGE_KEYS.PROCESSED_CODE,
5353
);
5454
processingRef.current = null;
5555
} finally {
@@ -86,14 +86,14 @@ export function OAuthCallbackHandler({ provider }: { provider: string }) {
8686

8787
// Also check sessionStorage as backup
8888
const processedCode = sessionStorage.getItem(
89-
OAUTH_CONFIG.SESSION_STORAGE_KEYS.PROCESSED_CODE
89+
OAUTH_CONFIG.SESSION_STORAGE_KEYS.PROCESSED_CODE,
9090
);
9191
if (processedCode === code) {
9292
return; // Already processed this code
9393
}
9494

9595
const storedState = sessionStorage.getItem(
96-
OAUTH_CONFIG.SESSION_STORAGE_KEYS.OAUTH_STATE
96+
OAUTH_CONFIG.SESSION_STORAGE_KEYS.OAUTH_STATE,
9797
);
9898
sessionStorage.removeItem(OAUTH_CONFIG.SESSION_STORAGE_KEYS.OAUTH_STATE);
9999

@@ -105,7 +105,7 @@ export function OAuthCallbackHandler({ provider }: { provider: string }) {
105105
// Mark this code as being processed in sessionStorage
106106
sessionStorage.setItem(
107107
OAUTH_CONFIG.SESSION_STORAGE_KEYS.PROCESSED_CODE,
108-
code
108+
code,
109109
);
110110
handleOAuthCallback(code, state);
111111
} else {

frontend/app/error.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ export default function Error({ error }: { error: Error }) {
6161
.toISOString()
6262
.replace("T", " ")
6363
.replace("Z", " UTC")}\n\n` +
64-
`Additional context:\n`
64+
`Additional context:\n`,
6565
);
6666
window.open(
6767
`${base}?labels=bug&title=${title}&body=${body}`,
6868
"_blank",
69-
"noopener,noreferrer"
69+
"noopener,noreferrer",
7070
);
7171
}}
7272
>

frontend/app/events/EventTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function EventsTable({ events }: { events: Event[] }) {
3535
};
3636

3737
const stateVariant = (
38-
state: EventState
38+
state: EventState,
3939
): "default" | "secondary" | "destructive" | "outline" => {
4040
switch (state) {
4141
case EventState.TEAM_FINDING:

frontend/app/events/[id]/dashboard/dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function DashboardPage({ eventId }: DashboardPageProps) {
5757
setParticipantsCount(participants);
5858
if (eventData?.repoLockDate) {
5959
setTeamAutoLockTime(
60-
new Date(eventData.repoLockDate).toISOString().slice(0, 16)
60+
new Date(eventData.repoLockDate).toISOString().slice(0, 16),
6161
);
6262
}
6363
setIsAdmin(true);
@@ -282,7 +282,7 @@ export function DashboardPage({ eventId }: DashboardPageProps) {
282282
onClick={() =>
283283
setEventTeamsLockDate(
284284
eventId,
285-
new Date(teamAutoLockTime).getTime()
285+
new Date(teamAutoLockTime).getTime(),
286286
).then(() => {
287287
alert("set team auto lock date");
288288
})

frontend/app/events/[id]/queue/queueState.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function QueueState(props: {
5656
<p
5757
className={cn(
5858
"text-sm text-muted-foreground",
59-
queueState.inQueue ? "text-green-500" : ""
59+
queueState.inQueue ? "text-green-500" : "",
6060
)}
6161
>
6262
Status: {queueState.inQueue ? "In Queue" : "Not in Queue"}

frontend/app/events/create/CreateEventForm.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type FormValues = z.infer<typeof formSchema>;
5757

5858
async function validateGithubToken(
5959
orgName: string,
60-
token: string
60+
token: string,
6161
): Promise<string | null> {
6262
const headers = {
6363
Authorization: `Bearer ${token}`,
@@ -88,7 +88,7 @@ async function validateGithubToken(
8888
// 2. Check for repository creation permissions (by trying to list repos)
8989
const reposResponse = await fetch(
9090
`https://api.github.com/orgs/${orgName}/repos?type=all`,
91-
{ headers }
91+
{ headers },
9292
);
9393
if (!reposResponse.ok) {
9494
let errorMessage = `Token lacks permission to list repositories in '${orgName}'. Required: 'repo' scope.`;
@@ -106,7 +106,7 @@ async function validateGithubToken(
106106
// 3. Check for invitation permissions (by trying to list members)
107107
const membersResponse = await fetch(
108108
`https://api.github.com/orgs/${orgName}/members`,
109-
{ headers }
109+
{ headers },
110110
);
111111
if (!membersResponse.ok) {
112112
let errorMessage = `Token lacks permission to list members in '${orgName}'. Required: 'admin:org' or 'read:org' scope.`;
@@ -134,7 +134,7 @@ async function validateGithubToken(
134134

135135
function combineImageAndTag(
136136
image: string | undefined,
137-
tag: string | undefined
137+
tag: string | undefined,
138138
): string | undefined {
139139
if (!image?.trim() || !tag?.trim()) {
140140
return image || undefined;
@@ -175,7 +175,7 @@ export default function CreateEventForm() {
175175

176176
// Extract owner/repo from a GitHub URL like https://github.com/owner/repo
177177
const parseGitHubRepo = (
178-
url: string
178+
url: string,
179179
): { owner: string; repo: string } | null => {
180180
try {
181181
const u = new URL(url.trim());
@@ -211,13 +211,13 @@ export default function CreateEventForm() {
211211
if (!res.ok) {
212212
const body = await res.json().catch(() => ({}));
213213
throw new Error(
214-
body?.message || `Failed to fetch tags (${res.status})`
214+
body?.message || `Failed to fetch tags (${res.status})`,
215215
);
216216
}
217217
const data: Array<{ name: string }> = await res.json();
218218
if (!cancelled) {
219219
setAvailableTags(
220-
Array.from(new Set((data || []).map((t) => t.name)))
220+
Array.from(new Set((data || []).map((t) => t.name))),
221221
);
222222
}
223223
} catch (e: any) {
@@ -239,7 +239,7 @@ export default function CreateEventForm() {
239239

240240
function combineImageAndTag(
241241
image: string | undefined,
242-
tag: string | undefined
242+
tag: string | undefined,
243243
): string | undefined {
244244
if (!image?.trim() || !tag?.trim()) {
245245
return image || undefined;
@@ -252,15 +252,15 @@ export default function CreateEventForm() {
252252

253253
const gameServerDockerImageString = combineImageAndTag(
254254
values.gameServerDockerImage,
255-
values.gameServerImageTag
255+
values.gameServerImageTag,
256256
);
257257
const myCoreBotDockerImageString = combineImageAndTag(
258258
values.myCoreBotDockerImage,
259-
values.myCoreBotImageTag
259+
values.myCoreBotImageTag,
260260
);
261261
const visualizerDockerImageString = combineImageAndTag(
262262
values.visualizerDockerImage,
263-
values.visualizerImageTag
263+
values.visualizerImageTag,
264264
);
265265

266266
if (!gameServerDockerImageString) {
@@ -278,7 +278,7 @@ export default function CreateEventForm() {
278278

279279
const validationError = await validateGithubToken(
280280
values.githubOrg,
281-
values.githubOrgSecret
281+
values.githubOrgSecret,
282282
);
283283
if (validationError) {
284284
setError(validationError);
@@ -387,7 +387,7 @@ export default function CreateEventForm() {
387387
variant="outline"
388388
className={cn(
389389
"w-full pl-3 text-left font-normal",
390-
!field.value && "text-muted-foreground"
390+
!field.value && "text-muted-foreground",
391391
)}
392392
>
393393
{field.value ? (
@@ -423,7 +423,7 @@ export default function CreateEventForm() {
423423
: new Date();
424424
newDate.setHours(
425425
parseInt(hours),
426-
parseInt(minutes)
426+
parseInt(minutes),
427427
);
428428
field.onChange(newDate);
429429
}}
@@ -449,7 +449,7 @@ export default function CreateEventForm() {
449449
variant="outline"
450450
className={cn(
451451
"w-full pl-3 text-left font-normal",
452-
!field.value && "text-muted-foreground"
452+
!field.value && "text-muted-foreground",
453453
)}
454454
>
455455
{field.value ? (
@@ -485,7 +485,7 @@ export default function CreateEventForm() {
485485
: new Date();
486486
newDate.setHours(
487487
parseInt(hours),
488-
parseInt(minutes)
488+
parseInt(minutes),
489489
);
490490
field.onChange(newDate);
491491
}}

frontend/components/QueueMatchesControls.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export default function QueueMatchesControls({
6767

6868
router.replace(`${pathname}?${params.toString()}`);
6969
},
70-
[interval, pathname, range.end, range.start, router, searchParams]
70+
[interval, pathname, range.end, range.start, router, searchParams],
7171
);
7272

7373
const canApply = useMemo(
7474
() => !!range.start && !!range.end,
75-
[range.end, range.start]
75+
[range.end, range.start],
7676
);
7777

7878
return (
@@ -105,7 +105,7 @@ export default function QueueMatchesControls({
105105
variant="outline"
106106
className={cn(
107107
"flex-1 justify-start text-left font-normal",
108-
!range.start && "text-muted-foreground"
108+
!range.start && "text-muted-foreground",
109109
)}
110110
>
111111
<CalendarIcon className="mr-2 h-4 w-4" />
@@ -150,7 +150,7 @@ export default function QueueMatchesControls({
150150
variant="outline"
151151
className={cn(
152152
"flex-1 justify-start text-left font-normal",
153-
!range.end && "text-muted-foreground"
153+
!range.end && "text-muted-foreground",
154154
)}
155155
>
156156
<CalendarIcon className="mr-2 h-4 w-4" />

frontend/components/QueueMatchesList.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function QueueMatchesList(props: {
3535
? "bg-success-100 text-success-700"
3636
: match.state === MatchState.IN_PROGRESS
3737
? "bg-warning-100 text-warning-700"
38-
: "bg-background text-foreground"
38+
: "bg-background text-foreground",
3939
)}
4040
>
4141
{match.state}
@@ -50,7 +50,7 @@ export default function QueueMatchesList(props: {
5050
"flex-1 text-center py-2 px-3 rounded-md",
5151
match.winner?.name === match.teams[0]?.name
5252
? "bg-success-50 border border-success-200"
53-
: ""
53+
: "",
5454
)}
5555
>
5656
<div className="font-medium">
@@ -61,7 +61,7 @@ export default function QueueMatchesList(props: {
6161
</div>
6262
<div className="text-xl font-bold mt-1">
6363
{match.results.find(
64-
(result) => result.team?.id === match.teams[0]?.id
64+
(result) => result.team?.id === match.teams[0]?.id,
6565
)?.score || 0}
6666
</div>
6767
</div>
@@ -73,7 +73,7 @@ export default function QueueMatchesList(props: {
7373
"flex-1 text-center py-2 px-3 rounded-md",
7474
match.winner?.name === match.teams[1]?.name
7575
? "bg-success-50 border border-success-200"
76-
: ""
76+
: "",
7777
)}
7878
>
7979
<div className="font-medium">
@@ -84,7 +84,7 @@ export default function QueueMatchesList(props: {
8484
</div>
8585
<div className="text-xl font-bold mt-1">
8686
{match.results.find(
87-
(result) => result.team?.id === match.teams[1]?.id
87+
(result) => result.team?.id === match.teams[1]?.id,
8888
)?.score || 0}
8989
</div>
9090
</div>

frontend/components/match/MatchLogsDisplay.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const parseAnsiColorCodes = (text: string) => {
8282

8383
export default function MatchLogsDisplay({ logs }: MatchLogsDisplayProps) {
8484
const [selectedTab, setSelectedTab] = useState<string>(
85-
logs.length > 0 ? logs[0].container : ""
85+
logs.length > 0 ? logs[0].container : "",
8686
);
8787
const [searchQuery, setSearchQuery] = useState<string>("");
8888

@@ -91,7 +91,7 @@ export default function MatchLogsDisplay({ logs }: MatchLogsDisplayProps) {
9191
if (!searchQuery.trim()) return logArray;
9292

9393
return logArray.filter((log) =>
94-
log.toLowerCase().includes(searchQuery.toLowerCase())
94+
log.toLowerCase().includes(searchQuery.toLowerCase()),
9595
);
9696
};
9797

frontend/components/social-accounts-display.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function SocialAccountsDisplay() {
3939
}, [session?.user?.id]);
4040

4141
const { message, isInitiating, initiate42OAuth, clearMessage } = use42Linking(
42-
loadSocialAccounts // Use the stable callback
42+
loadSocialAccounts, // Use the stable callback
4343
);
4444

4545
useEffect(() => {
@@ -51,7 +51,7 @@ export default function SocialAccountsDisplay() {
5151
// Clear any lingering error messages when we detect a new 42 account
5252
useEffect(() => {
5353
const has42Account = socialAccounts.some(
54-
(account) => account.platform === OAUTH_PROVIDERS.FORTY_TWO
54+
(account) => account.platform === OAUTH_PROVIDERS.FORTY_TWO,
5555
);
5656
if (has42Account && message?.type === "error") {
5757
// Clear error message after account is successfully linked
@@ -75,7 +75,7 @@ export default function SocialAccountsDisplay() {
7575
try {
7676
await unlinkSocialAccount(platform);
7777
setSocialAccounts((accounts) =>
78-
accounts.filter((account) => account.platform !== platform)
78+
accounts.filter((account) => account.platform !== platform),
7979
);
8080
} catch (error) {
8181
console.error("Error unlinking account:", error);
@@ -87,7 +87,7 @@ export default function SocialAccountsDisplay() {
8787

8888
const get42Account = () =>
8989
socialAccounts.find(
90-
(account) => account.platform === OAUTH_PROVIDERS.FORTY_TWO
90+
(account) => account.platform === OAUTH_PROVIDERS.FORTY_TWO,
9191
);
9292

9393
if (loading) {

0 commit comments

Comments
 (0)