From 8084d1e6b38e64992e1d415ebd371a97d56a3c20 Mon Sep 17 00:00:00 2001
From: "deepsource-autofix[bot]"
<62050782+deepsource-autofix[bot]@users.noreply.github.com>
Date: Thu, 25 Jul 2024 21:39:06 +0000
Subject: [PATCH] style: format code with StandardJS
This commit fixes the style issues introduced in 03c0278 according to the output
from StandardJS.
Details: None
---
src/pages/leaderboards.jsx | 185 ++++++++++++++++++-------------------
1 file changed, 92 insertions(+), 93 deletions(-)
diff --git a/src/pages/leaderboards.jsx b/src/pages/leaderboards.jsx
index 0542ba66..69caa15f 100644
--- a/src/pages/leaderboards.jsx
+++ b/src/pages/leaderboards.jsx
@@ -1,68 +1,68 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState } from 'react'
import {
ArrowRightIcon,
- QuestionMarkCircleIcon,
-} from '@heroicons/react/20/solid';
+ QuestionMarkCircleIcon
+} from '@heroicons/react/20/solid'
-import Head from 'next/head';
-import { StandardNav } from '@/components/StandardNav';
-import { Footer } from '@/components/Footer';
-import { PracticeNav } from '@/components/practice/PracticeNav';
-import { Community } from '@/components/practice/community';
-import { MyTable } from '@/components/Table';
+import Head from 'next/head'
+import { StandardNav } from '@/components/StandardNav'
+import { Footer } from '@/components/Footer'
+import { PracticeNav } from '@/components/practice/PracticeNav'
+import { Community } from '@/components/practice/community'
+import { MyTable } from '@/components/Table'
import {
TableHead,
TableRow,
TableHeader,
TableCell,
TableBody,
- Table,
-} from '@/components/ui/table';
-import request from '@/utils/request';
+ Table
+} from '@/components/ui/table'
+import request from '@/utils/request'
-export default function Leaderboard() {
- const [leaderboardData, setLeaderboardData] = useState([]);
+export default function Leaderboard () {
+ const [leaderboardData, setLeaderboardData] = useState([])
useEffect(() => {
// replace 'http://localhost:5000' with your backend URL
request(`${process.env.NEXT_PUBLIC_API_URL}/leaderboard/`, 'GET', null)
.then((response) => {
- setLeaderboardData(response.leaderboard);
- console.log('leaderboards: ', response.leaderboard);
+ setLeaderboardData(response.leaderboard)
+ console.log('leaderboards: ', response.leaderboard)
})
.catch((error) => {
- console.error('Error fetching leaderboard data: ', error);
- });
- }, []);
+ console.error('Error fetching leaderboard data: ', error)
+ })
+ }, [])
return (
<>
Leaderboards - CTFGuide
-
+
-
+
-
+
{
window.location.href =
- '../users/' + leaderboardData[1].user.username;
+ '../users/' + leaderboardData[1].user.username
}}
>
-
-
+
+
-
+
- -
- #2{' '}
+
-
+ #2{' '}
{leaderboardData[1]?.user?.username}
- -
+
-
{leaderboardData[1]?.totalPoints} points
@@ -90,18 +90,18 @@ export default function Leaderboard() {
{
window.location.href =
- '../users/' + leaderboardData[0].user.username;
+ '../users/' + leaderboardData[0].user.username
}}
>
-
-
+
+
-
+
- -
- #1{' '}
+
-
+ #1{' '}
{leaderboardData[0]?.user?.username}
-
- -
+
-
{leaderboardData[0]?.totalPoints} points
@@ -131,21 +130,21 @@ export default function Leaderboard() {
{
window.location.href =
- '../users/' + leaderboardData[2].user.username;
+ '../users/' + leaderboardData[2].user.username
}}
>
{
- //too poopy
+ // too poopy
}
-
-
+
+
-
+
- -
- #3{' '}
+
-
+ #3{' '}
{leaderboardData[2]?.user?.username}
- -
+
-
{leaderboardData[2]?.totalPoints} points
@@ -173,37 +172,37 @@ export default function Leaderboard() {
-
+
-
-
-
+
+
+
- Rank
+ Rank
Player
- Points
+ Points
{leaderboardData && leaderboardData.length > 3 && leaderboardData.slice(3).map((entry, index) => (
{
window.location.href =
- '../users/' + entry.user.username;
+ '../users/' + entry.user.username
}}
>
-
+
#{index + 4}
-
+
-
+
{entry.totalPoints}
@@ -246,9 +245,9 @@ export default function Leaderboard() {
-
+
>
- );
-}
\ No newline at end of file
+ )
+}