From bcfa5a298fea75f21da3d786a2463fb3e07a3af8 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:05:10 +0000 Subject: [PATCH] Add proper automatic import sorting. --- client/src/.eslintrc | 16 ++++++++++++++-- client/src/app/pages/ClientFileFlowPage.tsx | 2 +- client/src/app/pages/ErrorPage.tsx | 4 ++-- client/src/app/pages/ForgotPasswordPage.tsx | 4 ++-- client/src/app/pages/LandingPage.tsx | 2 +- client/src/app/pages/LoginPage.tsx | 6 +++--- client/src/app/pages/OAuthRequestAuthPage.tsx | 2 +- client/src/app/pages/RegisterPage.tsx | 6 +++--- client/src/app/pages/ResetPasswordPage.tsx | 4 ++-- client/src/app/pages/dashboard/DashboardPage.tsx | 8 ++++---- .../games/_game/_playtype/GPTChartPage.tsx | 8 ++++---- .../_game/_playtype/GPTLeaderboardsPage.tsx | 6 +++--- .../games/_game/_playtype/GPTMainPage.tsx | 10 +++++----- .../games/_game/_playtype/GPTSongsPage.tsx | 4 ++-- .../src/app/pages/dashboard/import/USCIRPage.tsx | 2 +- .../src/app/pages/dashboard/misc/CreditsPage.tsx | 4 ++-- .../pages/dashboard/users/ARCIntegrationPage.tsx | 2 +- .../dashboard/users/FervidexIntegrationPage.tsx | 2 +- .../app/pages/dashboard/users/UserGamesPage.tsx | 4 ++-- .../dashboard/users/UserIntegrationsPage.tsx | 4 ++-- .../pages/dashboard/users/UserInvitesPage.tsx | 6 +++--- .../src/app/pages/dashboard/users/UserPage.tsx | 2 +- .../pages/dashboard/users/UserSettingsPage.tsx | 4 ++-- .../games/_game/_playtype/LeaderboardsPage.tsx | 6 +++--- .../users/games/_game/_playtype/OverviewPage.tsx | 12 ++++++------ .../users/games/_game/_playtype/ScoresPage.tsx | 2 +- .../users/games/_game/_playtype/SessionsPage.tsx | 4 ++-- .../_game/_playtype/SpecificSessionPage.tsx | 6 +++--- .../games/_game/_playtype/UGPTSettingsPage.tsx | 2 +- .../_game/_playtype/folders/FolderSelectPage.tsx | 4 ++-- .../_game/_playtype/folders/FolderTablePage.tsx | 10 +++++----- .../_playtype/folders/SpecificFolderPage.tsx | 12 ++++++------ client/src/app/routes/AppRoutes.tsx | 2 +- client/src/app/routes/DashboardRoutes.tsx | 2 +- client/src/app/routes/GameRoutes.tsx | 10 +++++----- client/src/app/routes/UserRoutes.tsx | 4 ++-- client/src/components/charts/IIDXBPIChart.tsx | 2 +- client/src/components/charts/TimelineChart.tsx | 4 ++-- client/src/components/game/ClassBadge.tsx | 2 +- .../game/folder/FolderDistributionTable.tsx | 6 +++--- .../src/components/game/folder/FolderMinimap.tsx | 6 +++--- .../game/folder/FolderScoreDistributionChart.tsx | 12 ++++++------ .../src/components/game/songs/SongInfoFormat.tsx | 2 +- client/src/components/imports/ImportInfo.tsx | 4 ++-- client/src/components/layout/footer/Footer.tsx | 4 ++-- client/src/components/layout/header/Header.tsx | 2 +- .../src/components/layout/header/HeaderMenu.tsx | 2 +- .../components/layout/header/HeaderMobile.tsx | 2 +- .../src/components/layout/header/SearchBar.tsx | 4 ++-- .../layout/header/UserProfileDropdown.tsx | 6 +++--- .../components/layout/header/useSetSubheader.tsx | 2 +- .../components/layout/misc/BackgroundImage.tsx | 2 +- .../src/components/layout/misc/EmailVerify.tsx | 4 ++-- .../src/components/layout/misc/SplashImage.tsx | 2 +- .../components/layout/screens/LoadingScreen.tsx | 2 +- client/src/components/sessions/SessionCard.tsx | 8 ++++---- .../src/components/sessions/SessionOverview.tsx | 8 ++++---- .../sessions/SessionRaiseBreakdown.tsx | 8 ++++---- .../tables/cells/BMSDifficultyCell.tsx | 4 ++-- .../components/tables/cells/BMSOrPMSLampCell.tsx | 4 ++-- client/src/components/tables/cells/BPICell.tsx | 2 +- .../tables/cells/CHUNITHMJudgementCell.tsx | 2 +- client/src/components/tables/cells/DeltaCell.tsx | 2 +- .../components/tables/cells/DifficultyCell.tsx | 2 +- .../src/components/tables/cells/IIDXLampCell.tsx | 4 ++-- .../components/tables/cells/IndicatorsCell.tsx | 2 +- .../tables/cells/JubeatJudgementCell.tsx | 2 +- client/src/components/tables/cells/LampCell.tsx | 2 +- .../tables/cells/MillionsScoreCell.tsx | 4 ++-- .../tables/cells/MusecaJudgementCell.tsx | 2 +- .../tables/cells/PopnJudgementCell.tsx | 2 +- .../src/components/tables/cells/PopnLampCell.tsx | 4 ++-- .../src/components/tables/cells/RatingCell.tsx | 2 +- .../tables/cells/SDVXJudgementCell.tsx | 2 +- .../src/components/tables/cells/SDVXLampCell.tsx | 2 +- client/src/components/tables/cells/ScoreCell.tsx | 2 +- .../components/tables/cells/ScoreCellLarge.tsx | 2 +- .../components/tables/cells/TimestampCell.tsx | 2 +- client/src/components/tables/cells/TitleCell.tsx | 4 ++-- client/src/components/tables/cells/VF6Cell.tsx | 2 +- .../tables/cells/WACCAJudgementCell.tsx | 2 +- .../components/FilterDirectivesIndicator.tsx | 2 +- .../tables/components/SelectableRating.tsx | 2 +- .../components/tables/components/TachiTable.tsx | 4 ++-- .../tables/dropdowns/GenericSessionDropdown.tsx | 2 +- .../dropdowns/components/DocumentComponent.tsx | 4 ++-- .../components/DropdownScoreButtons.tsx | 2 +- .../components/IIDXScoreDropdownParts.tsx | 4 ++-- .../dropdowns/components/JudgementTable.tsx | 2 +- .../tables/dropdowns/components/ManageScore.tsx | 4 ++-- .../tables/dropdowns/components/PlayHistory.tsx | 2 +- .../dropdowns/components/ScoreEditButtons.tsx | 2 +- .../components/tables/folders/FolderTable.tsx | 4 ++-- .../tables/game-core-cells/CHUNITHMCoreCells.tsx | 4 ++-- .../tables/game-core-cells/JubeatCoreCells.tsx | 4 ++-- .../components/tables/headers/ChartHeader.tsx | 4 ++-- .../components/tables/headers/GameHeaders.tsx | 4 ++-- .../tables/headers/IndicatorHeader.tsx | 2 +- .../tables/history-scores/HistoryScoreTable.tsx | 2 +- client/src/components/tables/pbs/PBTable.tsx | 6 +++--- .../src/components/tables/scores/ScoreTable.tsx | 4 ++-- .../tables/sessions/GenericSessionTable.tsx | 8 ++++---- client/src/components/user/ProfilePicture.tsx | 2 +- client/src/components/user/UGPTHeader.tsx | 2 +- client/src/components/user/UGPTRankingData.tsx | 2 +- client/src/components/user/UGPTStatContainer.tsx | 2 +- client/src/components/user/UGPTStatCreator.tsx | 4 ++-- client/src/components/user/UGPTStatShowcase.tsx | 6 +++--- client/src/components/user/UGPTStatsOverview.tsx | 2 +- client/src/components/user/UserHeader.tsx | 4 ++-- client/src/components/util/ApiError.tsx | 2 +- client/src/components/util/SelectLinkButton.tsx | 2 +- client/src/components/util/SiteWordmark.tsx | 2 +- .../src/components/util/UpdateUserGameStats.tsx | 2 +- client/src/components/util/import/useImport.ts | 4 ++-- client/src/components/util/query/useApiQuery.tsx | 2 +- client/src/components/util/useSplashText.tsx | 4 ++-- client/src/context/BackgroundContext.tsx | 2 +- client/src/context/SubheaderContext.tsx | 2 +- client/src/context/UserSettingsContext.tsx | 2 +- client/src/lib/config.ts | 3 +-- client/src/util/misc.ts | 2 +- client/src/util/tables/create-search.ts | 6 +++--- client/src/util/tables/get-pb-leaders.ts | 2 +- client/src/util/ztable/search.ts | 2 +- 125 files changed, 243 insertions(+), 232 deletions(-) diff --git a/client/src/.eslintrc b/client/src/.eslintrc index 6d5be7e74..90a31ddc5 100644 --- a/client/src/.eslintrc +++ b/client/src/.eslintrc @@ -11,7 +11,10 @@ "@typescript-eslint", "import" ], - "ignorePatterns": ["**/*.js", "react-app-env.d.ts"], + "ignorePatterns": [ + "**/*.js", + "react-app-env.d.ts" + ], "parser": "@typescript-eslint/parser", "parserOptions": { "sourceType": "module", @@ -49,8 +52,17 @@ } ], "@typescript-eslint/explicit-function-return-type": "off", - "react/no-unescaped-entities": ["error", {"forbid": [">", "}"]}], + "react/no-unescaped-entities": [ + "error", + { + "forbid": [ + ">", + "}" + ] + } + ], "react/display-name": "off", + "import/order": "error", "import/no-unresolved": "off", "import/no-named-as-default": "off", "react/prop-types": "off", diff --git a/client/src/app/pages/ClientFileFlowPage.tsx b/client/src/app/pages/ClientFileFlowPage.tsx index 80a29335b..9a3f67d28 100644 --- a/client/src/app/pages/ClientFileFlowPage.tsx +++ b/client/src/app/pages/ClientFileFlowPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; import Loading from "components/util/Loading"; @@ -8,7 +9,6 @@ import { TachiConfig } from "lib/config"; import React, { useContext, useState } from "react"; import { Link, useParams } from "react-router-dom"; import { APITokenDocument, TachiAPIClientDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; export default function ClientFileFlowPage() { const { clientID } = useParams<{ clientID: string }>(); diff --git a/client/src/app/pages/ErrorPage.tsx b/client/src/app/pages/ErrorPage.tsx index 24afa4e65..41c570168 100644 --- a/client/src/app/pages/ErrorPage.tsx +++ b/client/src/app/pages/ErrorPage.tsx @@ -1,8 +1,8 @@ +import { ToCDNURL } from "util/api"; +import { HistorySafeGoBack } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import React from "react"; import { useHistory } from "react-router-dom"; -import { ToCDNURL } from "util/api"; -import { HistorySafeGoBack } from "util/misc"; export function ErrorPage({ statusCode, diff --git a/client/src/app/pages/ForgotPasswordPage.tsx b/client/src/app/pages/ForgotPasswordPage.tsx index 555376d92..17d237cc7 100644 --- a/client/src/app/pages/ForgotPasswordPage.tsx +++ b/client/src/app/pages/ForgotPasswordPage.tsx @@ -1,11 +1,11 @@ +import { APIFetchV1 } from "util/api"; +import { HistorySafeGoBack } from "util/misc"; import CenterPage from "components/util/CenterPage"; import SiteWordmark from "components/util/SiteWordmark"; import { Form, Col, Button } from "react-bootstrap"; import React, { useState } from "react"; import { Link, useHistory } from "react-router-dom"; -import { APIFetchV1 } from "util/api"; import MainPageTitleContainer from "components/util/MainPageTitleContainer"; -import { HistorySafeGoBack } from "util/misc"; export default function ForgotPasswordPage() { const [email, setEmail] = useState(""); diff --git a/client/src/app/pages/LandingPage.tsx b/client/src/app/pages/LandingPage.tsx index 93fce576b..6e3576b23 100644 --- a/client/src/app/pages/LandingPage.tsx +++ b/client/src/app/pages/LandingPage.tsx @@ -1,3 +1,4 @@ +import { ToCDNURL } from "util/api"; import { Footer } from "components/layout/footer/Footer"; import { Header } from "components/layout/header/Header"; import { HeaderMobile } from "components/layout/header/HeaderMobile"; @@ -5,7 +6,6 @@ import Divider from "components/util/Divider"; import LinkButton from "components/util/LinkButton"; import { TachiConfig } from "lib/config"; import React from "react"; -import { ToCDNURL } from "util/api"; // This page is currently unused, // It's alright, but hey, we could do more. diff --git a/client/src/app/pages/LoginPage.tsx b/client/src/app/pages/LoginPage.tsx index 92917047a..9df1eb1a2 100644 --- a/client/src/app/pages/LoginPage.tsx +++ b/client/src/app/pages/LoginPage.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1 } from "util/api"; +import { HumaniseError } from "util/humanise-error"; +import { HistorySafeGoBack } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import CenterPage from "components/util/CenterPage"; import SiteWordmark from "components/util/SiteWordmark"; @@ -9,9 +12,6 @@ import ReCAPTCHA from "react-google-recaptcha"; import toast from "react-hot-toast"; import { Link, useHistory } from "react-router-dom"; import { PublicUserDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; -import { HumaniseError } from "util/humanise-error"; -import { HistorySafeGoBack } from "util/misc"; export default function LoginPage() { useSetSubheader("Login"); diff --git a/client/src/app/pages/OAuthRequestAuthPage.tsx b/client/src/app/pages/OAuthRequestAuthPage.tsx index f1ef08ac7..3b52392a3 100644 --- a/client/src/app/pages/OAuthRequestAuthPage.tsx +++ b/client/src/app/pages/OAuthRequestAuthPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import CenterLayoutPage from "components/layout/CenterLayoutPage"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; @@ -8,7 +9,6 @@ import useQueryString from "components/util/useQueryString"; import React from "react"; import { Link } from "react-router-dom"; import { integer, TachiAPIClientDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; export default function OAuthRequestAuthPage() { const params = useQueryString(); diff --git a/client/src/app/pages/RegisterPage.tsx b/client/src/app/pages/RegisterPage.tsx index 567f5cf7e..2c9c662a9 100644 --- a/client/src/app/pages/RegisterPage.tsx +++ b/client/src/app/pages/RegisterPage.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1, ToCDNURL } from "util/api"; +import { HumaniseError } from "util/humanise-error"; +import { HistorySafeGoBack } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Divider from "components/util/Divider"; import { UserContext } from "context/UserContext"; @@ -10,9 +13,6 @@ import toast from "react-hot-toast"; import { Link, useHistory } from "react-router-dom"; import { PublicUserDocument } from "tachi-common"; import { UseFormik } from "types/react"; -import { APIFetchV1, ToCDNURL } from "util/api"; -import { HumaniseError } from "util/humanise-error"; -import { HistorySafeGoBack } from "util/misc"; // seconds it takes for a user to actually read the rules. const RULES_READ_TIME = Number(process.env.REACT_APP_RULES_READ_TIME) || 30; diff --git a/client/src/app/pages/ResetPasswordPage.tsx b/client/src/app/pages/ResetPasswordPage.tsx index 66043fca8..4d74aa103 100644 --- a/client/src/app/pages/ResetPasswordPage.tsx +++ b/client/src/app/pages/ResetPasswordPage.tsx @@ -1,9 +1,9 @@ +import { APIFetchV1 } from "util/api"; +import { ShortDelayify } from "util/misc"; import CenterPage from "components/util/CenterPage"; import MainPageTitleContainer from "components/util/MainPageTitleContainer"; import React, { useState } from "react"; import { Button, Form } from "react-bootstrap"; -import { APIFetchV1 } from "util/api"; -import { ShortDelayify } from "util/misc"; import { ErrorPage } from "./ErrorPage"; export default function ResetPasswordPage() { diff --git a/client/src/app/pages/dashboard/DashboardPage.tsx b/client/src/app/pages/dashboard/DashboardPage.tsx index 6c0b05c44..518ec4a6f 100644 --- a/client/src/app/pages/dashboard/DashboardPage.tsx +++ b/client/src/app/pages/dashboard/DashboardPage.tsx @@ -1,3 +1,7 @@ +import { APIFetchV1 } from "util/api"; +import { RFA } from "util/misc"; +import { NumericSOV } from "util/sorts"; +import { heySplashes } from "util/splashes"; import useSetSubheader from "components/layout/header/useSetSubheader"; import SessionCard from "components/sessions/SessionCard"; import ApiError from "components/util/ApiError"; @@ -15,10 +19,6 @@ import { Alert } from "react-bootstrap"; import { Link } from "react-router-dom"; import { GetGameConfig, PublicUserDocument } from "tachi-common"; import { UGSWithRankingData, UserRecentSummary } from "types/api-returns"; -import { APIFetchV1 } from "util/api"; -import { RFA } from "util/misc"; -import { NumericSOV } from "util/sorts"; -import { heySplashes } from "util/splashes"; import { GameStatContainer } from "./users/UserGamesPage"; export function DashboardPage() { diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx index 9020d3861..552e54b6c 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx @@ -1,3 +1,7 @@ +import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; +import { CreateUserMap } from "util/data"; +import { SelectRightChart } from "util/misc"; +import { MillisToSince } from "util/time"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import LampCell from "components/tables/cells/LampCell"; @@ -28,10 +32,6 @@ import { import { ChartPBLeaderboardReturn, UGPTChartLeaderboardAdjacent } from "types/api-returns"; import { GamePT, SetState } from "types/react"; import { PBDataset } from "types/tables"; -import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; -import { CreateUserMap } from "util/data"; -import { SelectRightChart } from "util/misc"; -import { MillisToSince } from "util/time"; // This component forms a wrapper around the Real GPT Chart Page // which handles the case where activeChart == null. diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTLeaderboardsPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTLeaderboardsPage.tsx index d9377ea30..3f8f16980 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTLeaderboardsPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTLeaderboardsPage.tsx @@ -1,3 +1,6 @@ +import { CreateChartMap, CreateSongMap, CreateUserMap } from "util/data"; +import { UppercaseFirst } from "util/misc"; +import { NumericSOV, StrSOV } from "util/sorts"; import ClassBadge from "components/game/ClassBadge"; import useSetSubheader from "components/layout/header/useSetSubheader"; import IndexCell from "components/tables/cells/IndexCell"; @@ -19,9 +22,6 @@ import { FormatGame, GetGameConfig, GetGamePTConfig } from "tachi-common"; import { ScoreLeaderboardReturns, UserLeaderboardReturns } from "types/api-returns"; import { GamePT } from "types/react"; import { PBDataset, UGSDataset } from "types/tables"; -import { CreateChartMap, CreateSongMap, CreateUserMap } from "util/data"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV, StrSOV } from "util/sorts"; export default function GPTLeaderboardsPage({ game, playtype }: GamePT) { useSetSubheader( diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx index e0a9d8cef..3578ab4ef 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx @@ -1,3 +1,8 @@ +import { APIFetchV1 } from "util/api"; +import { DEFAULT_BAR_PROPS } from "util/charts"; +import { CreateChartMap, CreateSongMap, CreateUserMap } from "util/data"; +import { UppercaseFirst } from "util/misc"; +import { MillisToSince } from "util/time"; import { ResponsiveBar } from "@nivo/bar"; import { BarChartTooltip } from "components/charts/ChartTooltip"; import ClassBadge from "components/game/ClassBadge"; @@ -30,11 +35,6 @@ import { import { RecentClassesReturn } from "types/api-returns"; import { GamePT } from "types/react"; import { ScoreDataset } from "types/tables"; -import { APIFetchV1 } from "util/api"; -import { DEFAULT_BAR_PROPS } from "util/charts"; -import { CreateChartMap, CreateSongMap, CreateUserMap } from "util/data"; -import { UppercaseFirst } from "util/misc"; -import { MillisToSince } from "util/time"; export default function GPTMainPage({ game, playtype }: GamePT) { useSetSubheader( diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTSongsPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTSongsPage.tsx index 642554fe2..b9abb1d39 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTSongsPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTSongsPage.tsx @@ -1,3 +1,5 @@ +import { CreateSongMap } from "util/data"; +import { NumericSOV, StrSOV } from "util/sorts"; import useSetSubheader from "components/layout/header/useSetSubheader"; import DifficultyCell from "components/tables/cells/DifficultyCell"; import TitleCell from "components/tables/cells/TitleCell"; @@ -18,8 +20,6 @@ import { SongDocument, } from "tachi-common"; import { GamePT } from "types/react"; -import { CreateSongMap } from "util/data"; -import { NumericSOV, StrSOV } from "util/sorts"; export default function GPTSongsPage({ game, playtype }: GamePT) { useSetSubheader( diff --git a/client/src/app/pages/dashboard/import/USCIRPage.tsx b/client/src/app/pages/dashboard/import/USCIRPage.tsx index 58bc86d7a..fda678b07 100644 --- a/client/src/app/pages/dashboard/import/USCIRPage.tsx +++ b/client/src/app/pages/dashboard/import/USCIRPage.tsx @@ -1,3 +1,4 @@ +import { ToServerURL } from "util/api"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Divider from "components/util/Divider"; import ExternalLink from "components/util/ExternalLink"; @@ -5,7 +6,6 @@ import Muted from "components/util/Muted"; import { TachiConfig } from "lib/config"; import React from "react"; import { Alert } from "react-bootstrap"; -import { ToServerURL } from "util/api"; export default function USCIRPage() { useSetSubheader(["Import Scores", "USC IR"]); diff --git a/client/src/app/pages/dashboard/misc/CreditsPage.tsx b/client/src/app/pages/dashboard/misc/CreditsPage.tsx index dbd20df24..d1ff00d82 100644 --- a/client/src/app/pages/dashboard/misc/CreditsPage.tsx +++ b/client/src/app/pages/dashboard/misc/CreditsPage.tsx @@ -1,3 +1,5 @@ +import { Contributors } from "util/constants/contributors"; +import { RFA } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Divider from "components/util/Divider"; import ExternalLink from "components/util/ExternalLink"; @@ -5,8 +7,6 @@ import { UserContext } from "context/UserContext"; import { TachiConfig } from "lib/config"; import React, { useContext, useState } from "react"; import { Link } from "react-router-dom"; -import { Contributors } from "util/constants/contributors"; -import { RFA } from "util/misc"; export default function CreditsPage() { useSetSubheader("Credits"); diff --git a/client/src/app/pages/dashboard/users/ARCIntegrationPage.tsx b/client/src/app/pages/dashboard/users/ARCIntegrationPage.tsx index 8bbe89018..02fc0326a 100644 --- a/client/src/app/pages/dashboard/users/ARCIntegrationPage.tsx +++ b/client/src/app/pages/dashboard/users/ARCIntegrationPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; import Loading from "components/util/Loading"; @@ -8,7 +9,6 @@ import { Button, Col, Form } from "react-bootstrap"; import { Link } from "react-router-dom"; import { ARCSavedProfileDocument, PublicUserDocument } from "tachi-common"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; export default function ARCIntegrationPage({ reqUser }: { reqUser: PublicUserDocument }) { const [iidxID, setIIDXID] = useState(""); diff --git a/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx b/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx index eb79adb40..4a99256ba 100644 --- a/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx +++ b/client/src/app/pages/dashboard/users/FervidexIntegrationPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; import Loading from "components/util/Loading"; @@ -6,7 +7,6 @@ import React, { useState } from "react"; import { Button, Col, Form } from "react-bootstrap"; import { Link } from "react-router-dom"; import { FervidexSettingsDocument, PublicUserDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; export default function FervidexIntegrationPage({ reqUser }: { reqUser: PublicUserDocument }) { const { data: settings, isLoading, error } = useApiQuery( diff --git a/client/src/app/pages/dashboard/users/UserGamesPage.tsx b/client/src/app/pages/dashboard/users/UserGamesPage.tsx index e2cd9a819..5148b8341 100644 --- a/client/src/app/pages/dashboard/users/UserGamesPage.tsx +++ b/client/src/app/pages/dashboard/users/UserGamesPage.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { GetSortedGPTs } from "util/site"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import RankingData from "components/user/UGPTRankingData"; @@ -9,8 +11,6 @@ import ReferToUser from "components/util/ReferToUser"; import React from "react"; import { FormatGame, PublicUserDocument, UserGameStats } from "tachi-common"; import { UGSWithRankingData } from "types/api-returns"; -import { APIFetchV1 } from "util/api"; -import { GetSortedGPTs } from "util/site"; interface Props { reqUser: PublicUserDocument; diff --git a/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx b/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx index 477e68d8f..3bace0348 100644 --- a/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx +++ b/client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { allPermissions, DelayedPageReload } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import ApiError from "components/util/ApiError"; @@ -21,8 +23,6 @@ import { TachiAPIClientDocument, } from "tachi-common"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { allPermissions, DelayedPageReload } from "util/misc"; import ARCIntegrationPage from "./ARCIntegrationPage"; import FervidexIntegrationPage from "./FervidexIntegrationPage"; diff --git a/client/src/app/pages/dashboard/users/UserInvitesPage.tsx b/client/src/app/pages/dashboard/users/UserInvitesPage.tsx index 92bddde77..994a6bb47 100644 --- a/client/src/app/pages/dashboard/users/UserInvitesPage.tsx +++ b/client/src/app/pages/dashboard/users/UserInvitesPage.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1 } from "util/api"; +import { DelayedPageReload } from "util/misc"; +import { FormatTime } from "util/time"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import ApiError from "components/util/ApiError"; @@ -9,9 +12,6 @@ import React from "react"; import { Button, Col, Row } from "react-bootstrap"; import { Link } from "react-router-dom"; import { integer, InviteCodeDocument, PublicUserDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; -import { DelayedPageReload } from "util/misc"; -import { FormatTime } from "util/time"; export default function UserInvitesPage({ reqUser }: { reqUser: PublicUserDocument }) { useSetSubheader( diff --git a/client/src/app/pages/dashboard/users/UserPage.tsx b/client/src/app/pages/dashboard/users/UserPage.tsx index 00a6e8f1a..60a758d72 100644 --- a/client/src/app/pages/dashboard/users/UserPage.tsx +++ b/client/src/app/pages/dashboard/users/UserPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import Divider from "components/util/Divider"; @@ -8,7 +9,6 @@ import React, { useContext, useEffect, useState } from "react"; import { Button } from "react-bootstrap"; import ReactMarkdown from "react-markdown"; import { PublicUserDocument } from "tachi-common"; -import { APIFetchV1 } from "util/api"; interface Props { reqUser: PublicUserDocument; diff --git a/client/src/app/pages/dashboard/users/UserSettingsPage.tsx b/client/src/app/pages/dashboard/users/UserSettingsPage.tsx index 850a5cf75..4d877779d 100644 --- a/client/src/app/pages/dashboard/users/UserSettingsPage.tsx +++ b/client/src/app/pages/dashboard/users/UserSettingsPage.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1, ToAPIURL } from "util/api"; +import { DelayedPageReload, FetchJSONBody, UppercaseFirst } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; import ProfilePicture from "components/user/ProfilePicture"; @@ -11,8 +13,6 @@ import { TachiConfig } from "lib/config"; import React, { useContext, useState } from "react"; import { Alert, Button, Form } from "react-bootstrap"; import { PublicUserDocument, UserSettings } from "tachi-common"; -import { APIFetchV1, ToAPIURL } from "util/api"; -import { DelayedPageReload, FetchJSONBody, UppercaseFirst } from "util/misc"; interface Props { reqUser: PublicUserDocument; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx index e90fefd94..4f33c528d 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/LeaderboardsPage.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; +import { ChangeOpacity } from "util/color-opacity"; +import { UppercaseFirst } from "util/misc"; import ClassBadge from "components/game/ClassBadge"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; @@ -22,9 +25,6 @@ import { import { GameClassSets } from "tachi-common/js/game-classes"; import { GPTLeaderboard, UGPTLeaderboardAdjacent } from "types/api-returns"; import { GamePT, SetState } from "types/react"; -import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; -import { ChangeOpacity } from "util/color-opacity"; -import { UppercaseFirst } from "util/misc"; interface LeaderboardsData { stats: UGPTLeaderboardAdjacent; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx index 7d31186d4..8998f137d 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/OverviewPage.tsx @@ -1,3 +1,9 @@ +import { APIFetchV1 } from "util/api"; +import { ONE_HOUR, ONE_MINUTE } from "util/constants/time"; +import { CreateChartMap, CreateSongMap, GetPBs } from "util/data"; +import { UppercaseFirst } from "util/misc"; +import { NumericSOV } from "util/sorts"; +import { FormatDate, FormatDuration, FormatTime, MillisToSince } from "util/time"; import TimelineChart from "components/charts/TimelineChart"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; @@ -25,12 +31,6 @@ import { import { SessionReturns, UGPTHistory } from "types/api-returns"; import { GamePT } from "types/react"; import { ScoreDataset } from "types/tables"; -import { APIFetchV1 } from "util/api"; -import { ONE_HOUR, ONE_MINUTE } from "util/constants/time"; -import { CreateChartMap, CreateSongMap, GetPBs } from "util/data"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV } from "util/sorts"; -import { FormatDate, FormatDuration, FormatTime, MillisToSince } from "util/time"; export default function OverviewPage({ reqUser, diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/ScoresPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/ScoresPage.tsx index b78e33b4a..1d7079255 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/ScoresPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/ScoresPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import useSetSubheader from "components/layout/header/useSetSubheader"; import PBTable from "components/tables/pbs/PBTable"; import ScoreTable from "components/tables/scores/ScoreTable"; @@ -26,7 +27,6 @@ import { UnsuccessfulAPIResponse, } from "tachi-common"; import { GamePT, SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; export default function ScoresPage({ reqUser, diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/SessionsPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/SessionsPage.tsx index f43bb9e1d..c06633fda 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/SessionsPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/SessionsPage.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { NumericSOV } from "util/sorts"; import useSetSubheader from "components/layout/header/useSetSubheader"; import GenericSessionTable, { SessionDataset, @@ -17,8 +19,6 @@ import { UnsuccessfulAPIResponse, } from "tachi-common"; import { GamePT } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { NumericSOV } from "util/sorts"; export default function SessionsPage({ reqUser, diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/SpecificSessionPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/SpecificSessionPage.tsx index 9d8c788a5..eab5d3880 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/SpecificSessionPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/SpecificSessionPage.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1 } from "util/api"; +import { CreateChartMap, CreateScoreIDMap, CreateSongMap } from "util/data"; +import { DelayedPageReload } from "util/misc"; import useSetSubheader from "components/layout/header/useSetSubheader"; import SessionOverview from "components/sessions/SessionOverview"; import SessionRaiseBreakdown from "components/sessions/SessionRaiseBreakdown"; @@ -16,9 +19,6 @@ import { Redirect, useParams } from "react-router-dom"; import { GetGameConfig, PublicUserDocument, SessionDocument } from "tachi-common"; import { SessionReturns } from "types/api-returns"; import { GamePT, SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { CreateChartMap, CreateScoreIDMap, CreateSongMap } from "util/data"; -import { DelayedPageReload } from "util/misc"; type Props = { reqUser: PublicUserDocument } & GamePT; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/UGPTSettingsPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/UGPTSettingsPage.tsx index cb0755f30..8020636fd 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/UGPTSettingsPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/UGPTSettingsPage.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import ClassBadge from "components/game/ClassBadge"; import useSetSubheader from "components/layout/header/useSetSubheader"; import Card from "components/layout/page/Card"; @@ -27,7 +28,6 @@ import { UGPTSettings, } from "tachi-common"; import { GamePT, SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; type Props = { reqUser: PublicUserDocument } & GamePT; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderSelectPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderSelectPage.tsx index 2f4f3671a..c82644989 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderSelectPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderSelectPage.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { Reverse } from "util/misc"; import DistributionTable from "components/game/folder/FolderDistributionTable"; import Card from "components/layout/page/Card"; import DebounceSearch from "components/util/DebounceSearch"; @@ -14,8 +16,6 @@ import React, { useContext, useMemo, useState } from "react"; import { FolderDocument, GetGamePTConfig, PublicUserDocument } from "tachi-common"; import { FolderStatsInfo, UGPTFolderSearch } from "types/api-returns"; import { GamePT } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { Reverse } from "util/misc"; type Props = { reqUser: PublicUserDocument } & GamePT; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderTablePage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderTablePage.tsx index 288ea666d..cbb9ccda4 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderTablePage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/FolderTablePage.tsx @@ -1,3 +1,8 @@ +import { APIFetchV1 } from "util/api"; +import { DEFAULT_BAR_PROPS } from "util/charts"; +import { ChangeOpacity } from "util/color-opacity"; +import { Reverse } from "util/misc"; +import { NumericSOV, StrSOV } from "util/sorts"; import { ResponsiveBar } from "@nivo/bar"; import { BarChartTooltip } from "components/charts/ChartTooltip"; import Card from "components/layout/page/Card"; @@ -25,11 +30,6 @@ import { } from "tachi-common"; import { FolderStatsInfo, UGPTTableReturns } from "types/api-returns"; import { Playtype } from "types/tachi"; -import { APIFetchV1 } from "util/api"; -import { DEFAULT_BAR_PROPS } from "util/charts"; -import { ChangeOpacity } from "util/color-opacity"; -import { Reverse } from "util/misc"; -import { NumericSOV, StrSOV } from "util/sorts"; interface Props { reqUser: PublicUserDocument; diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/SpecificFolderPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/SpecificFolderPage.tsx index b5e4548b6..c699d335c 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/SpecificFolderPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/folders/SpecificFolderPage.tsx @@ -1,3 +1,9 @@ +import { ONE_DAY } from "util/constants/time"; +import { CreateChartIDMap, CreateChartLink, CreateSongMap } from "util/data"; +import { DistinctArr, NO_OP } from "util/misc"; +import { NumericSOV, StrSOV } from "util/sorts"; +import { GetScaleAchievedFn } from "util/tierlist"; +import { FormatDate, FormatTime } from "util/time"; import FolderInfoHeader from "components/game/folder/FolderInfoHeader"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import Card from "components/layout/page/Card"; @@ -30,12 +36,6 @@ import { import { UGPTFolderReturns } from "types/api-returns"; import { FolderDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { ONE_DAY } from "util/constants/time"; -import { CreateChartIDMap, CreateChartLink, CreateSongMap } from "util/data"; -import { DistinctArr, NO_OP } from "util/misc"; -import { NumericSOV, StrSOV } from "util/sorts"; -import { GetScaleAchievedFn } from "util/tierlist"; -import { FormatDate, FormatTime } from "util/time"; interface Props { reqUser: PublicUserDocument; diff --git a/client/src/app/routes/AppRoutes.tsx b/client/src/app/routes/AppRoutes.tsx index cd95bf5f7..e0a083ac0 100644 --- a/client/src/app/routes/AppRoutes.tsx +++ b/client/src/app/routes/AppRoutes.tsx @@ -1,3 +1,4 @@ +import { HistorySafeGoBack } from "util/misc"; import { ErrorPage } from "app/pages/ErrorPage"; import ForgotPasswordPage from "app/pages/ForgotPasswordPage"; import LoginPage from "app/pages/LoginPage"; @@ -12,7 +13,6 @@ import { UserContext } from "context/UserContext"; import { ClientConfig } from "lib/config"; import React, { useContext } from "react"; import { Redirect, Route, Switch, useHistory } from "react-router-dom"; -import { HistorySafeGoBack } from "util/misc"; import ClientFileFlowRoutes from "./ClientFileFlowRoutes"; import DashboardRoutes from "./DashboardRoutes"; import OAuth2CallbackRoutes from "./OAuth2CallbackRoutes"; diff --git a/client/src/app/routes/DashboardRoutes.tsx b/client/src/app/routes/DashboardRoutes.tsx index bf3d3322c..2dc548f5f 100644 --- a/client/src/app/routes/DashboardRoutes.tsx +++ b/client/src/app/routes/DashboardRoutes.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import SupportMePage from "app/pages/dashboard/misc/SupportMePage"; import { ErrorPage } from "app/pages/ErrorPage"; import PrivacyPolicyPage from "app/pages/PrivacyPolicyPage"; @@ -8,7 +9,6 @@ import { BannedContext } from "context/BannedContext"; import { UserContext } from "context/UserContext"; import React, { useContext, useEffect, useState } from "react"; import { Redirect, Route, Switch } from "react-router-dom"; -import { APIFetchV1 } from "util/api"; import { DashboardPage } from "../pages/dashboard/DashboardPage"; import CreditsPage from "../pages/dashboard/misc/CreditsPage"; import GameRoutes from "./GameRoutes"; diff --git a/client/src/app/routes/GameRoutes.tsx b/client/src/app/routes/GameRoutes.tsx index a69eb2c67..fc8dcf337 100644 --- a/client/src/app/routes/GameRoutes.tsx +++ b/client/src/app/routes/GameRoutes.tsx @@ -1,3 +1,8 @@ +import { APIFetchV1, ToCDNURL } from "util/api"; +import { IsSupportedGame, IsSupportedPlaytype } from "util/asserts"; +import { ChangeOpacity } from "util/color-opacity"; +import { CreateChartLink } from "util/data"; +import { NumericSOV } from "util/sorts"; import PlaytypeSelect from "app/pages/dashboard/games/_game/PlaytypeSelect"; import GPTChartPage from "app/pages/dashboard/games/_game/_playtype/GPTChartPage"; import GPTDevInfo from "app/pages/dashboard/games/_game/_playtype/GPTDevInfo"; @@ -35,11 +40,6 @@ import { } from "tachi-common"; import { SongsReturn } from "types/api-returns"; import { GamePT, SetState } from "types/react"; -import { APIFetchV1, ToCDNURL } from "util/api"; -import { IsSupportedGame, IsSupportedPlaytype } from "util/asserts"; -import { ChangeOpacity } from "util/color-opacity"; -import { CreateChartLink } from "util/data"; -import { NumericSOV } from "util/sorts"; export default function GameRoutes() { const { game } = useParams<{ game: string }>(); diff --git a/client/src/app/routes/UserRoutes.tsx b/client/src/app/routes/UserRoutes.tsx index a7d51dd9f..9aa90c7d7 100644 --- a/client/src/app/routes/UserRoutes.tsx +++ b/client/src/app/routes/UserRoutes.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1, APIFetchV1Return, ToAPIURL } from "util/api"; +import { IsSupportedGame, IsSupportedPlaytype } from "util/asserts"; import PlaytypeSelect from "app/pages/dashboard/games/_game/PlaytypeSelect"; import AchievablesPage from "app/pages/dashboard/users/games/_game/_playtype/AchievablesPage"; import FoldersMainPage from "app/pages/dashboard/users/games/_game/_playtype/folders/FoldersMainPage"; @@ -32,8 +34,6 @@ import { UserGameStats, } from "tachi-common"; import { UGPTStatsReturn } from "types/api-returns"; -import { APIFetchV1, APIFetchV1Return, ToAPIURL } from "util/api"; -import { IsSupportedGame, IsSupportedPlaytype } from "util/asserts"; import ScoresPage from "../pages/dashboard/users/games/_game/_playtype/ScoresPage"; import UserPage from "../pages/dashboard/users/UserPage"; diff --git a/client/src/components/charts/IIDXBPIChart.tsx b/client/src/components/charts/IIDXBPIChart.tsx index cc092cce9..f82362cde 100644 --- a/client/src/components/charts/IIDXBPIChart.tsx +++ b/client/src/components/charts/IIDXBPIChart.tsx @@ -1,3 +1,4 @@ +import { GetGradeFromPercent } from "util/misc"; import { ResponsiveLine } from "@nivo/line"; import BPICell from "components/tables/cells/BPICell"; import DeltaCell from "components/tables/cells/DeltaCell"; @@ -16,7 +17,6 @@ import { PBScoreDocument, ScoreDocument, } from "tachi-common"; -import { GetGradeFromPercent } from "util/misc"; import ChartTooltip from "./ChartTooltip"; interface BPIValue { diff --git a/client/src/components/charts/TimelineChart.tsx b/client/src/components/charts/TimelineChart.tsx index 32ed8deac..6c7c81357 100644 --- a/client/src/components/charts/TimelineChart.tsx +++ b/client/src/components/charts/TimelineChart.tsx @@ -1,8 +1,8 @@ +import { TACHI_CHART_THEME } from "util/constants/chart-theme"; import React from "react"; import { ResponsiveLine, Serie, PointTooltipProps } from "@nivo/line"; -import { TACHI_CHART_THEME } from "util/constants/chart-theme"; -import ChartTooltip from "./ChartTooltip"; import { ColourConfig } from "lib/config"; +import ChartTooltip from "./ChartTooltip"; export default function TimelineChart({ width = "100%", diff --git a/client/src/components/game/ClassBadge.tsx b/client/src/components/game/ClassBadge.tsx index b576e5bdc..d1355cd7f 100644 --- a/client/src/components/game/ClassBadge.tsx +++ b/client/src/components/game/ClassBadge.tsx @@ -1,10 +1,10 @@ +import { UppercaseFirst } from "util/misc"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import React from "react"; import { Badge } from "react-bootstrap"; import { GetGamePTConfig, IDStrings, integer } from "tachi-common"; import { GameClassSets } from "tachi-common/js/game-classes"; import { GamePT } from "types/react"; -import { UppercaseFirst } from "util/misc"; export default function ClassBadge({ game, diff --git a/client/src/components/game/folder/FolderDistributionTable.tsx b/client/src/components/game/folder/FolderDistributionTable.tsx index 7705581d1..c4f93222a 100644 --- a/client/src/components/game/folder/FolderDistributionTable.tsx +++ b/client/src/components/game/folder/FolderDistributionTable.tsx @@ -1,12 +1,12 @@ +import { ChangeOpacity } from "util/color-opacity"; +import { TACHI_CHART_THEME } from "util/constants/chart-theme"; +import { Reverse, StepFromToMax, PercentFrom } from "util/misc"; import { ResponsiveBar } from "@nivo/bar"; import { BarChartTooltip } from "components/charts/ChartTooltip"; import MiniTable from "components/tables/components/MiniTable"; import Muted from "components/util/Muted"; import React from "react"; import { integer } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; -import { TACHI_CHART_THEME } from "util/constants/chart-theme"; -import { Reverse, StepFromToMax, PercentFrom } from "util/misc"; export default function FolderDistributionTable({ keys, diff --git a/client/src/components/game/folder/FolderMinimap.tsx b/client/src/components/game/folder/FolderMinimap.tsx index ca5fa51fe..f4577b5ef 100644 --- a/client/src/components/game/folder/FolderMinimap.tsx +++ b/client/src/components/game/folder/FolderMinimap.tsx @@ -1,3 +1,6 @@ +import { ChangeOpacity } from "util/color-opacity"; +import { CreateChartLink } from "util/data"; +import { NumericSOV } from "util/sorts"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import ApiError from "components/util/ApiError"; import Divider from "components/util/Divider"; @@ -18,9 +21,6 @@ import { } from "tachi-common"; import { GamePT } from "types/react"; import { FolderDataset } from "types/tables"; -import { ChangeOpacity } from "util/color-opacity"; -import { CreateChartLink } from "util/data"; -import { NumericSOV } from "util/sorts"; type Props = { folderDataset: FolderDataset; diff --git a/client/src/components/game/folder/FolderScoreDistributionChart.tsx b/client/src/components/game/folder/FolderScoreDistributionChart.tsx index 0c36b438e..43b9e4acf 100644 --- a/client/src/components/game/folder/FolderScoreDistributionChart.tsx +++ b/client/src/components/game/folder/FolderScoreDistributionChart.tsx @@ -1,15 +1,15 @@ -import { ResponsiveBar } from "@nivo/bar"; -import { BarChartTooltip } from "components/charts/ChartTooltip"; -import React, { useMemo } from "react"; -import { GetGamePTConfig } from "tachi-common"; -import { GamePT } from "types/react"; -import { FolderDataset } from "types/tables"; import { DEFAULT_BAR_PROPS } from "util/charts"; import { ChangeOpacity } from "util/color-opacity"; import { CreateChartIDMap } from "util/data"; import { ComposeExpFn, ComposeInverseExpFn, CountElements, Reverse } from "util/misc"; import { GetGradeChartExpScale } from "util/scales"; import { NumericSOV } from "util/sorts"; +import { ResponsiveBar } from "@nivo/bar"; +import { BarChartTooltip } from "components/charts/ChartTooltip"; +import React, { useMemo } from "react"; +import { GetGamePTConfig } from "tachi-common"; +import { GamePT } from "types/react"; +import { FolderDataset } from "types/tables"; import FolderDistributionTable from "./FolderDistributionTable"; type Props = { diff --git a/client/src/components/game/songs/SongInfoFormat.tsx b/client/src/components/game/songs/SongInfoFormat.tsx index 1ad269eba..ea8c4183e 100644 --- a/client/src/components/game/songs/SongInfoFormat.tsx +++ b/client/src/components/game/songs/SongInfoFormat.tsx @@ -1,6 +1,6 @@ +import { FormatBMSTables } from "util/misc"; import React from "react"; import { ChartDocument, FormatDifficulty, Game, SongDocument } from "tachi-common"; -import { FormatBMSTables } from "util/misc"; import DefaultSongChartInfoFormat from "./DefaultSongInfoFormat"; export default function SongChartInfoFormat({ diff --git a/client/src/components/imports/ImportInfo.tsx b/client/src/components/imports/ImportInfo.tsx index d46acc7b2..4d27b363c 100644 --- a/client/src/components/imports/ImportInfo.tsx +++ b/client/src/components/imports/ImportInfo.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { CreateChartMap, CreateSongMap } from "util/data"; import MiniTable from "components/tables/components/MiniTable"; import TachiTable from "components/tables/components/TachiTable"; import ScoreTable from "components/tables/scores/ScoreTable"; @@ -24,8 +26,6 @@ import { } from "tachi-common"; import { ScoreDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { APIFetchV1 } from "util/api"; -import { CreateChartMap, CreateSongMap } from "util/data"; interface Data { import: ImportDocument; diff --git a/client/src/components/layout/footer/Footer.tsx b/client/src/components/layout/footer/Footer.tsx index 94214f2d0..b96e51c6a 100644 --- a/client/src/components/layout/footer/Footer.tsx +++ b/client/src/components/layout/footer/Footer.tsx @@ -1,11 +1,11 @@ +import { APIFetchV1 } from "util/api"; +import { FORMATTED_VERSION } from "util/constants/version"; import Divider from "components/util/Divider"; import ExternalLink from "components/util/ExternalLink"; import { BannedContext } from "context/BannedContext"; import React, { useContext, useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { ServerStatus } from "types/api-returns"; -import { APIFetchV1 } from "util/api"; -import { FORMATTED_VERSION } from "util/constants/version"; export function Footer() { const [serverVersion, setServerVersion] = useState("Loading..."); diff --git a/client/src/components/layout/header/Header.tsx b/client/src/components/layout/header/Header.tsx index 8c2a3d0f4..4879cd38a 100644 --- a/client/src/components/layout/header/Header.tsx +++ b/client/src/components/layout/header/Header.tsx @@ -1,6 +1,6 @@ +import { ToCDNURL } from "util/api"; import React from "react"; import { Link } from "react-router-dom"; -import { ToCDNURL } from "util/api"; import { HeaderMenu } from "./HeaderMenu"; import { Topbar } from "./Topbar"; diff --git a/client/src/components/layout/header/HeaderMenu.tsx b/client/src/components/layout/header/HeaderMenu.tsx index 60374d986..85087bc28 100644 --- a/client/src/components/layout/header/HeaderMenu.tsx +++ b/client/src/components/layout/header/HeaderMenu.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1, ToCDNURL } from "util/api"; import Divider from "components/util/Divider"; import Loading from "components/util/Loading"; import { UserContext } from "context/UserContext"; @@ -7,7 +8,6 @@ import React, { useContext, useLayoutEffect } from "react"; import { useQuery } from "react-query"; import { Link } from "react-router-dom"; import { FormatGame, GetGameConfig, UserGameStats } from "tachi-common"; -import { APIFetchV1, ToCDNURL } from "util/api"; import KTLayoutHeader from "_metronic/_assets/js/layout/base/header"; import KTLayoutHeaderMenu from "_metronic/_assets/js/layout/base/header-menu"; import AllGames from "./AllGames"; diff --git a/client/src/components/layout/header/HeaderMobile.tsx b/client/src/components/layout/header/HeaderMobile.tsx index a3b21c515..956ecd86c 100644 --- a/client/src/components/layout/header/HeaderMobile.tsx +++ b/client/src/components/layout/header/HeaderMobile.tsx @@ -1,7 +1,7 @@ +import { ToAPIURL } from "util/api"; import { UserContext } from "context/UserContext"; import React, { useContext } from "react"; import { Link } from "react-router-dom"; -import { ToAPIURL } from "util/api"; export function HeaderMobile() { const { user } = useContext(UserContext); diff --git a/client/src/components/layout/header/SearchBar.tsx b/client/src/components/layout/header/SearchBar.tsx index 44fc54969..7882de5a0 100644 --- a/client/src/components/layout/header/SearchBar.tsx +++ b/client/src/components/layout/header/SearchBar.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { ConditionalLeadingSpace, PREVENT_DEFAULT } from "util/misc"; import Divider from "components/util/Divider"; import Icon from "components/util/Icon"; import Loading from "components/util/Loading"; @@ -7,8 +9,6 @@ import { Link, useLocation } from "react-router-dom"; import { Game, GetGameConfig, integer, PublicUserDocument, SongDocument } from "tachi-common"; import { GamePT, JustChildren } from "types/react"; import { Playtype } from "types/tachi"; -import { APIFetchV1 } from "util/api"; -import { ConditionalLeadingSpace, PREVENT_DEFAULT } from "util/misc"; import QuickTooltip from "../misc/QuickTooltip"; interface SearchReturns { diff --git a/client/src/components/layout/header/UserProfileDropdown.tsx b/client/src/components/layout/header/UserProfileDropdown.tsx index 1d179cb5b..5b6223f7b 100644 --- a/client/src/components/layout/header/UserProfileDropdown.tsx +++ b/client/src/components/layout/header/UserProfileDropdown.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1, ToAPIURL } from "util/api"; +import { RFA } from "util/misc"; +import { heySplashes } from "util/splashes"; import Divider from "components/util/Divider"; import DropdownToggleOverride from "components/util/DropdownToggleOverride"; import Icon from "components/util/Icon"; @@ -8,9 +11,6 @@ import Dropdown from "react-bootstrap/Dropdown"; import toast from "react-hot-toast"; import { Link } from "react-router-dom"; import { PublicUserDocument } from "tachi-common"; -import { APIFetchV1, ToAPIURL } from "util/api"; -import { RFA } from "util/misc"; -import { heySplashes } from "util/splashes"; export function UserProfileDropdown({ user }: { user: PublicUserDocument }) { const { setUser } = useContext(UserContext); diff --git a/client/src/components/layout/header/useSetSubheader.tsx b/client/src/components/layout/header/useSetSubheader.tsx index ae81f94c4..8dda09bde 100644 --- a/client/src/components/layout/header/useSetSubheader.tsx +++ b/client/src/components/layout/header/useSetSubheader.tsx @@ -1,7 +1,7 @@ +import { UpdateSubheader } from "util/subheader"; import useSplashText from "components/util/useSplashText"; import { SubheaderContext } from "context/SubheaderContext"; import { useContext, useEffect } from "react"; -import { UpdateSubheader } from "util/subheader"; export default function useSetSubheader( content: string[] | string, diff --git a/client/src/components/layout/misc/BackgroundImage.tsx b/client/src/components/layout/misc/BackgroundImage.tsx index 4cfd27540..9a560ad4a 100644 --- a/client/src/components/layout/misc/BackgroundImage.tsx +++ b/client/src/components/layout/misc/BackgroundImage.tsx @@ -1,6 +1,6 @@ +import { ToCDNURL } from "util/api"; import { BackgroundContext } from "context/BackgroundContext"; import React, { useContext } from "react"; -import { ToCDNURL } from "util/api"; export default function BackgroundImage() { const { background } = useContext(BackgroundContext); diff --git a/client/src/components/layout/misc/EmailVerify.tsx b/client/src/components/layout/misc/EmailVerify.tsx index 8dd4b2332..ec388984a 100644 --- a/client/src/components/layout/misc/EmailVerify.tsx +++ b/client/src/components/layout/misc/EmailVerify.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { ONE_MINUTE } from "util/constants/time"; import Divider from "components/util/Divider"; import Muted from "components/util/Muted"; import { UserContext } from "context/UserContext"; @@ -5,8 +7,6 @@ import React, { useContext, useEffect } from "react"; import { Button } from "react-bootstrap"; import toast from "react-hot-toast"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { ONE_MINUTE } from "util/constants/time"; import useSetSubheader from "../header/useSetSubheader"; export default function EmailVerify({ diff --git a/client/src/components/layout/misc/SplashImage.tsx b/client/src/components/layout/misc/SplashImage.tsx index 25ed84e9c..c0abcdc64 100644 --- a/client/src/components/layout/misc/SplashImage.tsx +++ b/client/src/components/layout/misc/SplashImage.tsx @@ -1,6 +1,6 @@ +import { ToCDNURL } from "util/api"; import { TachiConfig } from "lib/config"; import React from "react"; -import { ToCDNURL } from "util/api"; export default function SplashImage() { return ( diff --git a/client/src/components/layout/screens/LoadingScreen.tsx b/client/src/components/layout/screens/LoadingScreen.tsx index 1928b4c7c..86dc39735 100644 --- a/client/src/components/layout/screens/LoadingScreen.tsx +++ b/client/src/components/layout/screens/LoadingScreen.tsx @@ -1,9 +1,9 @@ +import { APIFetchV1 } from "util/api"; import { UserContext } from "context/UserContext"; import { TachiConfig } from "lib/config"; import React, { useContext, useEffect, useState } from "react"; import { PublicUserDocument } from "tachi-common"; import { JustChildren } from "types/react"; -import { APIFetchV1 } from "util/api"; import { SplashScreen } from "./SplashScreen"; export function LoadingScreen({ children }: JustChildren) { diff --git a/client/src/components/sessions/SessionCard.tsx b/client/src/components/sessions/SessionCard.tsx index eb3f713f5..183def45c 100644 --- a/client/src/components/sessions/SessionCard.tsx +++ b/client/src/components/sessions/SessionCard.tsx @@ -1,3 +1,7 @@ +import { APIFetchV1 } from "util/api"; +import { CreateChartMap, CreateSongMap } from "util/data"; +import { NumericSOV } from "util/sorts"; +import { FormatDuration } from "util/time"; import Card from "components/layout/page/Card"; import ScoreTable from "components/tables/scores/ScoreTable"; import ApiError from "components/util/ApiError"; @@ -14,10 +18,6 @@ import toast from "react-hot-toast"; import { SessionDocument } from "tachi-common"; import { SessionReturns } from "types/api-returns"; import { ScoreDataset } from "types/tables"; -import { APIFetchV1 } from "util/api"; -import { CreateChartMap, CreateSongMap } from "util/data"; -import { NumericSOV } from "util/sorts"; -import { FormatDuration } from "util/time"; export default function SessionCard({ sessionID }: { sessionID: string }) { const { user } = useContext(UserContext); diff --git a/client/src/components/sessions/SessionOverview.tsx b/client/src/components/sessions/SessionOverview.tsx index e3f172a81..063f8779c 100644 --- a/client/src/components/sessions/SessionOverview.tsx +++ b/client/src/components/sessions/SessionOverview.tsx @@ -1,3 +1,7 @@ +import { TACHI_CHART_THEME } from "util/constants/chart-theme"; +import { UppercaseFirst } from "util/misc"; +import { NumericSOV } from "util/sorts"; +import { FormatDuration } from "util/time"; import { ResponsiveLine } from "@nivo/line"; import ChartTooltip from "components/charts/ChartTooltip"; import Card from "components/layout/page/Card"; @@ -12,10 +16,6 @@ import { ChartDocument, GetGamePTConfig, ScoreDocument, SongDocument } from "tac import { SessionReturns } from "types/api-returns"; import { GamePT } from "types/react"; import { ScoreDataset } from "types/tables"; -import { TACHI_CHART_THEME } from "util/constants/chart-theme"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV } from "util/sorts"; -import { FormatDuration } from "util/time"; export default function SessionOverview({ sessionData, diff --git a/client/src/components/sessions/SessionRaiseBreakdown.tsx b/client/src/components/sessions/SessionRaiseBreakdown.tsx index 8876047b2..c882b6ca0 100644 --- a/client/src/components/sessions/SessionRaiseBreakdown.tsx +++ b/client/src/components/sessions/SessionRaiseBreakdown.tsx @@ -1,3 +1,7 @@ +import { APIFetchV1 } from "util/api"; +import { ChangeOpacity } from "util/color-opacity"; +import { CreateChartMap, CreateScoreIDMap, CreateSongMap } from "util/data"; +import { PartialArrayRecordAssign } from "util/misc"; import DifficultyCell from "components/tables/cells/DifficultyCell"; import LampCell from "components/tables/cells/LampCell"; import ScoreCell from "components/tables/cells/ScoreCell"; @@ -26,10 +30,6 @@ import { TableDocument, } from "tachi-common"; import { SessionReturns } from "types/api-returns"; -import { APIFetchV1 } from "util/api"; -import { ChangeOpacity } from "util/color-opacity"; -import { CreateChartMap, CreateScoreIDMap, CreateSongMap } from "util/data"; -import { PartialArrayRecordAssign } from "util/misc"; export default function SessionRaiseBreakdown({ sessionData }: { sessionData: SessionReturns }) { const game = sessionData.session.game; diff --git a/client/src/components/tables/cells/BMSDifficultyCell.tsx b/client/src/components/tables/cells/BMSDifficultyCell.tsx index d52d84568..f2b61b1c1 100644 --- a/client/src/components/tables/cells/BMSDifficultyCell.tsx +++ b/client/src/components/tables/cells/BMSDifficultyCell.tsx @@ -1,9 +1,9 @@ +import { ChangeOpacity } from "util/color-opacity"; +import { FormatBMSTables } from "util/misc"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import Icon from "components/util/Icon"; import React from "react"; import { ChartDocument, COLOUR_SET } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; -import { FormatBMSTables } from "util/misc"; import TierlistInfoPart from "./TierlistInfoPart"; export default function BMSPMSDifficultyCell({ diff --git a/client/src/components/tables/cells/BMSOrPMSLampCell.tsx b/client/src/components/tables/cells/BMSOrPMSLampCell.tsx index f30c0774b..e779a7af4 100644 --- a/client/src/components/tables/cells/BMSOrPMSLampCell.tsx +++ b/client/src/components/tables/cells/BMSOrPMSLampCell.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { ChangeOpacity } from "util/color-opacity"; import { IsNotNullish } from "util/misc"; +import React from "react"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; export default function BMSOrPMSLampCell({ score, diff --git a/client/src/components/tables/cells/BPICell.tsx b/client/src/components/tables/cells/BPICell.tsx index a218385bd..105456fb8 100644 --- a/client/src/components/tables/cells/BPICell.tsx +++ b/client/src/components/tables/cells/BPICell.tsx @@ -1,3 +1,4 @@ +import { GetGradeFromPercent, IsNullish } from "util/misc"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import Divider from "components/util/Divider"; import Muted from "components/util/Muted"; @@ -6,7 +7,6 @@ import { UserContext } from "context/UserContext"; import React, { useContext } from "react"; import { PoyashiBPI } from "rg-stats"; import { ChartDocument, integer, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { GetGradeFromPercent, IsNullish } from "util/misc"; import MiniTable from "../components/MiniTable"; import DeltaCell from "./DeltaCell"; import ScoreCell from "./ScoreCell"; diff --git a/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx b/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx index b5c2bda07..70ef30add 100644 --- a/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx +++ b/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function CHUNITHMJudgementCell({ score, diff --git a/client/src/components/tables/cells/DeltaCell.tsx b/client/src/components/tables/cells/DeltaCell.tsx index 8fb0d26e4..f2a60eaab 100644 --- a/client/src/components/tables/cells/DeltaCell.tsx +++ b/client/src/components/tables/cells/DeltaCell.tsx @@ -1,6 +1,6 @@ +import { GenericFormatGradeDelta } from "util/grade-deltas"; import React from "react"; import { Game, Grades, IDStrings, Playtypes } from "tachi-common"; -import { GenericFormatGradeDelta } from "util/grade-deltas"; export default function DeltaCell({ game, diff --git a/client/src/components/tables/cells/DifficultyCell.tsx b/client/src/components/tables/cells/DifficultyCell.tsx index 07b7b243b..dd49b29d9 100644 --- a/client/src/components/tables/cells/DifficultyCell.tsx +++ b/client/src/components/tables/cells/DifficultyCell.tsx @@ -1,3 +1,4 @@ +import { ChangeOpacity } from "util/color-opacity"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import Icon from "components/util/Icon"; import Muted from "components/util/Muted"; @@ -9,7 +10,6 @@ import { Game, GetGamePTConfig, } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; import BMSPMSDifficultyCell from "./BMSDifficultyCell"; import TierlistInfoPart from "./TierlistInfoPart"; diff --git a/client/src/components/tables/cells/IIDXLampCell.tsx b/client/src/components/tables/cells/IIDXLampCell.tsx index 789a6f508..08d2301a0 100644 --- a/client/src/components/tables/cells/IIDXLampCell.tsx +++ b/client/src/components/tables/cells/IIDXLampCell.tsx @@ -1,8 +1,8 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { IsScore } from "util/asserts"; import { ChangeOpacity } from "util/color-opacity"; import { IsNotNullish } from "util/misc"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; +import React from "react"; export default function IIDXLampCell({ sc, diff --git a/client/src/components/tables/cells/IndicatorsCell.tsx b/client/src/components/tables/cells/IndicatorsCell.tsx index 29eca6631..8eaa2c31c 100644 --- a/client/src/components/tables/cells/IndicatorsCell.tsx +++ b/client/src/components/tables/cells/IndicatorsCell.tsx @@ -1,5 +1,5 @@ -import React from "react"; import { ChangeOpacity } from "util/color-opacity"; +import React from "react"; export default function IndicatorsCell({ highlight }: { highlight: boolean }) { return ( diff --git a/client/src/components/tables/cells/JubeatJudgementCell.tsx b/client/src/components/tables/cells/JubeatJudgementCell.tsx index 66b88859c..0e7a6e3b4 100644 --- a/client/src/components/tables/cells/JubeatJudgementCell.tsx +++ b/client/src/components/tables/cells/JubeatJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function JubeatJudgementCell({ score, diff --git a/client/src/components/tables/cells/LampCell.tsx b/client/src/components/tables/cells/LampCell.tsx index 63bc5267a..169c2f6eb 100644 --- a/client/src/components/tables/cells/LampCell.tsx +++ b/client/src/components/tables/cells/LampCell.tsx @@ -1,6 +1,6 @@ +import { ChangeOpacity } from "util/color-opacity"; import React from "react"; import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; export default function LampCell({ score }: { score: ScoreDocument | PBScoreDocument }) { const gptConfig = GetGamePTConfig(score.game, score.playtype); diff --git a/client/src/components/tables/cells/MillionsScoreCell.tsx b/client/src/components/tables/cells/MillionsScoreCell.tsx index 198aba951..5406e31ef 100644 --- a/client/src/components/tables/cells/MillionsScoreCell.tsx +++ b/client/src/components/tables/cells/MillionsScoreCell.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { ChangeOpacity } from "util/color-opacity"; import { FormatMillions } from "util/misc"; +import React from "react"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; export default function MillionsScoreCell({ score }: { score: PBScoreDocument | ScoreDocument }) { const gptConfig = GetGamePTConfig(score.game, score.playtype); diff --git a/client/src/components/tables/cells/MusecaJudgementCell.tsx b/client/src/components/tables/cells/MusecaJudgementCell.tsx index 1aba1184b..93dbde732 100644 --- a/client/src/components/tables/cells/MusecaJudgementCell.tsx +++ b/client/src/components/tables/cells/MusecaJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function MusecaJudgementCell({ score, diff --git a/client/src/components/tables/cells/PopnJudgementCell.tsx b/client/src/components/tables/cells/PopnJudgementCell.tsx index 8b6f49164..c475ed780 100644 --- a/client/src/components/tables/cells/PopnJudgementCell.tsx +++ b/client/src/components/tables/cells/PopnJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function PopnJudgementCell({ score, diff --git a/client/src/components/tables/cells/PopnLampCell.tsx b/client/src/components/tables/cells/PopnLampCell.tsx index fb627c8ce..6751ae2a8 100644 --- a/client/src/components/tables/cells/PopnLampCell.tsx +++ b/client/src/components/tables/cells/PopnLampCell.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { ToCDNURL } from "util/api"; import { ChangeOpacity } from "util/color-opacity"; +import React from "react"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; export default function PopnLampCell({ score, diff --git a/client/src/components/tables/cells/RatingCell.tsx b/client/src/components/tables/cells/RatingCell.tsx index 6e86fa23d..7501f8c25 100644 --- a/client/src/components/tables/cells/RatingCell.tsx +++ b/client/src/components/tables/cells/RatingCell.tsx @@ -1,6 +1,6 @@ +import { FormatScoreRating, IsNotNullish } from "util/misc"; import React from "react"; import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { FormatScoreRating, IsNotNullish } from "util/misc"; export default function RatingCell({ score, diff --git a/client/src/components/tables/cells/SDVXJudgementCell.tsx b/client/src/components/tables/cells/SDVXJudgementCell.tsx index dd8412675..90fb4c159 100644 --- a/client/src/components/tables/cells/SDVXJudgementCell.tsx +++ b/client/src/components/tables/cells/SDVXJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function SDVXJudgementCell({ score, diff --git a/client/src/components/tables/cells/SDVXLampCell.tsx b/client/src/components/tables/cells/SDVXLampCell.tsx index 42a9a23cf..eb9fbd70b 100644 --- a/client/src/components/tables/cells/SDVXLampCell.tsx +++ b/client/src/components/tables/cells/SDVXLampCell.tsx @@ -1,6 +1,6 @@ +import { ChangeOpacity } from "util/color-opacity"; import React from "react"; import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; // Lamp cell, but if the lamp is FAILED, display it slightly differently. export default function SDVXLampCell({ diff --git a/client/src/components/tables/cells/ScoreCell.tsx b/client/src/components/tables/cells/ScoreCell.tsx index b2f2064ad..c90eb86ee 100644 --- a/client/src/components/tables/cells/ScoreCell.tsx +++ b/client/src/components/tables/cells/ScoreCell.tsx @@ -1,6 +1,6 @@ +import { ChangeOpacity } from "util/color-opacity"; import React from "react"; import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { ChangeOpacity } from "util/color-opacity"; export default function ScoreCell({ score, diff --git a/client/src/components/tables/cells/ScoreCellLarge.tsx b/client/src/components/tables/cells/ScoreCellLarge.tsx index 520581d7e..fd9ce2417 100644 --- a/client/src/components/tables/cells/ScoreCellLarge.tsx +++ b/client/src/components/tables/cells/ScoreCellLarge.tsx @@ -1,7 +1,7 @@ +import { FormatMillions } from "util/misc"; import React from "react"; import { Game, PBScoreDocument, ScoreDocument } from "tachi-common"; import { Playtype } from "types/tachi"; -import { FormatMillions } from "util/misc"; import ScoreCell from "./ScoreCell"; export default function ScoreCellLarge(props: { diff --git a/client/src/components/tables/cells/TimestampCell.tsx b/client/src/components/tables/cells/TimestampCell.tsx index 65889fac2..0424ac2e7 100644 --- a/client/src/components/tables/cells/TimestampCell.tsx +++ b/client/src/components/tables/cells/TimestampCell.tsx @@ -1,6 +1,6 @@ +import { FormatTime, MillisToSince } from "util/time"; import React from "react"; import { integer } from "tachi-common"; -import { FormatTime, MillisToSince } from "util/time"; export default function TimestampCell({ time, diff --git a/client/src/components/tables/cells/TitleCell.tsx b/client/src/components/tables/cells/TitleCell.tsx index 848fd3e90..f7909e6f9 100644 --- a/client/src/components/tables/cells/TitleCell.tsx +++ b/client/src/components/tables/cells/TitleCell.tsx @@ -1,9 +1,9 @@ +import { ToCDNURL } from "util/api"; +import { CreateChartLink } from "util/data"; import GentleLink from "components/util/GentleLink"; import Muted from "components/util/Muted"; import React from "react"; import { ChartDocument, Game, SongDocument } from "tachi-common"; -import { ToCDNURL } from "util/api"; -import { CreateChartLink } from "util/data"; export default function TitleCell({ game, diff --git a/client/src/components/tables/cells/VF6Cell.tsx b/client/src/components/tables/cells/VF6Cell.tsx index ec95898e3..994565168 100644 --- a/client/src/components/tables/cells/VF6Cell.tsx +++ b/client/src/components/tables/cells/VF6Cell.tsx @@ -1,9 +1,9 @@ +import { IsNullish } from "util/misc"; import useUGPTSettings from "components/util/useUGPTSettings"; import { UserContext } from "context/UserContext"; import React, { useContext } from "react"; import { Volforce } from "rg-stats"; import { ChartDocument, GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; type VF6IDStrings = "sdvx:Single" | "usc:Keyboard" | "usc:Controller"; diff --git a/client/src/components/tables/cells/WACCAJudgementCell.tsx b/client/src/components/tables/cells/WACCAJudgementCell.tsx index d1f14c4b2..3a8f01f66 100644 --- a/client/src/components/tables/cells/WACCAJudgementCell.tsx +++ b/client/src/components/tables/cells/WACCAJudgementCell.tsx @@ -1,6 +1,6 @@ +import { IsNullish } from "util/misc"; import React from "react"; import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsNullish } from "util/misc"; export default function WaccaJudgementCell({ score, diff --git a/client/src/components/tables/components/FilterDirectivesIndicator.tsx b/client/src/components/tables/components/FilterDirectivesIndicator.tsx index 819d4e08c..32d85bbee 100644 --- a/client/src/components/tables/components/FilterDirectivesIndicator.tsx +++ b/client/src/components/tables/components/FilterDirectivesIndicator.tsx @@ -1,3 +1,4 @@ +import { GetValueGetter, ValueGetterOrHybrid } from "util/ztable/search"; import Divider from "components/util/Divider"; import ExternalLink from "components/util/ExternalLink"; import HoverText from "components/util/HoverText"; @@ -6,7 +7,6 @@ import StickyPopover from "components/util/StickyPopover"; import { nanoid } from "nanoid"; import React, { useState } from "react"; import { Modal, OverlayTrigger, Tooltip } from "react-bootstrap"; -import { GetValueGetter, ValueGetterOrHybrid } from "util/ztable/search"; function AdditionalTableProps({ value, diff --git a/client/src/components/tables/components/SelectableRating.tsx b/client/src/components/tables/components/SelectableRating.tsx index 9584f76b7..ba1986449 100644 --- a/client/src/components/tables/components/SelectableRating.tsx +++ b/client/src/components/tables/components/SelectableRating.tsx @@ -1,3 +1,4 @@ +import { UppercaseFirst } from "util/misc"; import React from "react"; import { Game, @@ -7,7 +8,6 @@ import { ScoreCalculatedDataLookup, } from "tachi-common"; import { SetState } from "types/react"; -import { UppercaseFirst } from "util/misc"; import { ZTableTHProps } from "./TachiTable"; // type AllRatings = diff --git a/client/src/components/tables/components/TachiTable.tsx b/client/src/components/tables/components/TachiTable.tsx index 61952ff10..1a985e81b 100644 --- a/client/src/components/tables/components/TachiTable.tsx +++ b/client/src/components/tables/components/TachiTable.tsx @@ -1,3 +1,5 @@ +import { CopyToClipboard } from "util/misc"; +import { ComposeSearchFunction, ValueGetterOrHybrid } from "util/ztable/search"; import Icon from "components/util/Icon"; import SmallText from "components/util/SmallText"; import { useZTable, ZTableSortFn } from "components/util/table/useZTable"; @@ -6,8 +8,6 @@ import { json2csvAsync } from "json-2-csv"; import React, { useContext, useState } from "react"; import { Button } from "react-bootstrap"; import { integer } from "tachi-common"; -import { CopyToClipboard } from "util/misc"; -import { ComposeSearchFunction, ValueGetterOrHybrid } from "util/ztable/search"; import FilterDirectivesIndicator from "./FilterDirectivesIndicator"; import NoDataWrapper from "./NoDataWrapper"; import PageSelector from "./PageSelector"; diff --git a/client/src/components/tables/dropdowns/GenericSessionDropdown.tsx b/client/src/components/tables/dropdowns/GenericSessionDropdown.tsx index fe5e73146..ae4d5c395 100644 --- a/client/src/components/tables/dropdowns/GenericSessionDropdown.tsx +++ b/client/src/components/tables/dropdowns/GenericSessionDropdown.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import SessionRaiseBreakdown from "components/sessions/SessionRaiseBreakdown"; import DebugContent from "components/util/DebugContent"; import HasDevModeOn from "components/util/HasDevModeOn"; @@ -7,7 +8,6 @@ import SelectButton from "components/util/SelectButton"; import React, { useState } from "react"; import { useQuery } from "react-query"; import { SessionReturns } from "types/api-returns"; -import { APIFetchV1 } from "util/api"; import { SessionDataset } from "../sessions/GenericSessionTable"; import DropdownStructure from "./components/DropdownStructure"; diff --git a/client/src/components/tables/dropdowns/components/DocumentComponent.tsx b/client/src/components/tables/dropdowns/components/DocumentComponent.tsx index 2399fb2b6..b47db5609 100644 --- a/client/src/components/tables/dropdowns/components/DocumentComponent.tsx +++ b/client/src/components/tables/dropdowns/components/DocumentComponent.tsx @@ -1,3 +1,5 @@ +import { IsScore } from "util/asserts"; +import { UppercaseFirst } from "util/misc"; import TimestampCell from "components/tables/cells/TimestampCell"; import ScoreCoreCells from "components/tables/game-core-cells/ScoreCoreCells"; import useScoreRatingAlg from "components/util/useScoreRatingAlg"; @@ -5,8 +7,6 @@ import React, { useEffect, useState } from "react"; import { ChartDocument, PBScoreDocument, ScoreDocument } from "tachi-common"; import { UGPTChartPBComposition } from "types/api-returns"; import { SetState } from "types/react"; -import { IsScore } from "util/asserts"; -import { UppercaseFirst } from "util/misc"; import CommentContainer from "./CommentContainer"; import JudgementTable from "./JudgementTable"; import PBNote from "./PBNote"; diff --git a/client/src/components/tables/dropdowns/components/DropdownScoreButtons.tsx b/client/src/components/tables/dropdowns/components/DropdownScoreButtons.tsx index ef22362b9..5f3dbda69 100644 --- a/client/src/components/tables/dropdowns/components/DropdownScoreButtons.tsx +++ b/client/src/components/tables/dropdowns/components/DropdownScoreButtons.tsx @@ -1,5 +1,5 @@ -import React, { useEffect, useState } from "react"; import { IsScore } from "util/asserts"; +import React, { useEffect, useState } from "react"; import { ScoreDropdownProps } from "../PBDropdown"; import CommentContainer from "./CommentContainer"; import { ScoreInfo } from "./DocumentComponent"; diff --git a/client/src/components/tables/dropdowns/components/IIDXScoreDropdownParts.tsx b/client/src/components/tables/dropdowns/components/IIDXScoreDropdownParts.tsx index 9de63f8e9..2da96a89b 100644 --- a/client/src/components/tables/dropdowns/components/IIDXScoreDropdownParts.tsx +++ b/client/src/components/tables/dropdowns/components/IIDXScoreDropdownParts.tsx @@ -1,3 +1,5 @@ +import { IsScore } from "util/asserts"; +import { IsNotNullish, IsNullish } from "util/misc"; import IIDXBPIChart from "components/charts/IIDXBPIChart"; import IIDXLampChart from "components/charts/IIDXLampChart"; import DebugContent from "components/util/DebugContent"; @@ -5,8 +7,6 @@ import SelectNav from "components/util/SelectNav"; import React, { useEffect, useState } from "react"; import { Nav } from "react-bootstrap"; import { ChartDocument, PBScoreDocument, ScoreDocument } from "tachi-common"; -import { IsScore } from "util/asserts"; -import { IsNotNullish, IsNullish } from "util/misc"; // export function ModsTable({ score }: { score: ScoreDocument<"iidx:SP" | "iidx:DP"> }) { // if (!score.scoreMeta.assist && !score.scoreMeta.random) { diff --git a/client/src/components/tables/dropdowns/components/JudgementTable.tsx b/client/src/components/tables/dropdowns/components/JudgementTable.tsx index f40c5261e..880147885 100644 --- a/client/src/components/tables/dropdowns/components/JudgementTable.tsx +++ b/client/src/components/tables/dropdowns/components/JudgementTable.tsx @@ -1,8 +1,8 @@ +import { ChangeOpacity } from "util/color-opacity"; import MiniTable from "components/tables/components/MiniTable"; import React from "react"; import { COLOUR_SET, GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { GamePT } from "types/react"; -import { ChangeOpacity } from "util/color-opacity"; export default function JudgementTable({ score }: { score: ScoreDocument | PBScoreDocument }) { const gptConfig = GetGamePTConfig(score.game, score.playtype); diff --git a/client/src/components/tables/dropdowns/components/ManageScore.tsx b/client/src/components/tables/dropdowns/components/ManageScore.tsx index c1271743d..ca3dfbe24 100644 --- a/client/src/components/tables/dropdowns/components/ManageScore.tsx +++ b/client/src/components/tables/dropdowns/components/ManageScore.tsx @@ -1,7 +1,7 @@ -import React, { useMemo, useReducer, useState } from "react"; -import { ScoreDocument } from "tachi-common"; import { APIFetchV1 } from "util/api"; import { DelayedPageReload } from "util/misc"; +import React, { useMemo, useReducer, useState } from "react"; +import { ScoreDocument } from "tachi-common"; export default function ManageScore({ score }: { score: ScoreDocument }) { const [warn, upgWarn] = useReducer(r => r + 1, 0); diff --git a/client/src/components/tables/dropdowns/components/PlayHistory.tsx b/client/src/components/tables/dropdowns/components/PlayHistory.tsx index 97bcfdbd7..973f5bd93 100644 --- a/client/src/components/tables/dropdowns/components/PlayHistory.tsx +++ b/client/src/components/tables/dropdowns/components/PlayHistory.tsx @@ -1,9 +1,9 @@ +import { UnsuccessfulAPIFetchResponse } from "util/api"; import HistoryScoreTable from "components/tables/history-scores/HistoryScoreTable"; import Loading from "components/util/Loading"; import React from "react"; import { ChartDocument, ScoreDocument } from "tachi-common"; import { GamePT } from "types/react"; -import { UnsuccessfulAPIFetchResponse } from "util/api"; export default function PlayHistory({ data, diff --git a/client/src/components/tables/dropdowns/components/ScoreEditButtons.tsx b/client/src/components/tables/dropdowns/components/ScoreEditButtons.tsx index 5d24b2f8e..a2e102d40 100644 --- a/client/src/components/tables/dropdowns/components/ScoreEditButtons.tsx +++ b/client/src/components/tables/dropdowns/components/ScoreEditButtons.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import Icon from "components/util/Icon"; import { UserContext } from "context/UserContext"; @@ -5,7 +6,6 @@ import React, { useContext, useState } from "react"; import { Game, ScoreDocument } from "tachi-common"; import { Button, Modal, Form } from "react-bootstrap"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; import LinkButton from "components/util/LinkButton"; import ExternalLink from "components/util/ExternalLink"; import ImgScoreButton from "./ImgScoreButton"; diff --git a/client/src/components/tables/folders/FolderTable.tsx b/client/src/components/tables/folders/FolderTable.tsx index 21b584321..6d92f5895 100644 --- a/client/src/components/tables/folders/FolderTable.tsx +++ b/client/src/components/tables/folders/FolderTable.tsx @@ -1,10 +1,10 @@ +import { NumericSOV, StrSOV } from "util/sorts"; +import { CreateDefaultFolderSearchParams } from "util/tables/create-search"; import useScoreRatingAlg from "components/util/useScoreRatingAlg"; import React, { useState } from "react"; import { Game, IDStrings, ScoreCalculatedDataLookup } from "tachi-common"; import { FolderDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { NumericSOV, StrSOV } from "util/sorts"; -import { CreateDefaultFolderSearchParams } from "util/tables/create-search"; import DifficultyCell from "../cells/DifficultyCell"; import IndicatorsCell from "../cells/IndicatorsCell"; import RankingCell from "../cells/RankingCell"; diff --git a/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx index 3ef2139c8..6ffa03391 100644 --- a/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx +++ b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { ChangeOpacity } from "util/color-opacity"; import { FormatMillions } from "util/misc"; +import React from "react"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import CHUNITHMJudgementCell from "../cells/CHUNITHMJudgementCell"; import LampCell from "../cells/LampCell"; import RatingCell from "../cells/RatingCell"; diff --git a/client/src/components/tables/game-core-cells/JubeatCoreCells.tsx b/client/src/components/tables/game-core-cells/JubeatCoreCells.tsx index a7f98e615..409e7f7d5 100644 --- a/client/src/components/tables/game-core-cells/JubeatCoreCells.tsx +++ b/client/src/components/tables/game-core-cells/JubeatCoreCells.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import { ChangeOpacity } from "util/color-opacity"; import { FormatMillions } from "util/misc"; +import React from "react"; +import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common"; import JubeatJudgementCell from "../cells/JubeatJudgementCell"; import LampCell from "../cells/LampCell"; import RatingCell from "../cells/RatingCell"; diff --git a/client/src/components/tables/headers/ChartHeader.tsx b/client/src/components/tables/headers/ChartHeader.tsx index 279e16168..c33ffaa5a 100644 --- a/client/src/components/tables/headers/ChartHeader.tsx +++ b/client/src/components/tables/headers/ChartHeader.tsx @@ -1,8 +1,8 @@ +import { IsNotNullish } from "util/misc"; +import { NumericSOV } from "util/sorts"; import { ChartDocument, Game } from "tachi-common"; import { FolderDataset, PBDataset, ScoreDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { IsNotNullish } from "util/misc"; -import { NumericSOV } from "util/sorts"; import { Header } from "../components/TachiTable"; function CascadingTierlistValue( diff --git a/client/src/components/tables/headers/GameHeaders.tsx b/client/src/components/tables/headers/GameHeaders.tsx index d6423a900..5333b1e09 100644 --- a/client/src/components/tables/headers/GameHeaders.tsx +++ b/client/src/components/tables/headers/GameHeaders.tsx @@ -1,3 +1,5 @@ +import { UppercaseFirst } from "util/misc"; +import { NumericSOV } from "util/sorts"; import React from "react"; import { Game, @@ -10,8 +12,6 @@ import { import { SetState } from "types/react"; import { FolderDataset, PBDataset, ScoreDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV } from "util/sorts"; import SelectableRating from "../components/SelectableRating"; import { Header, ZTableTHProps } from "../components/TachiTable"; diff --git a/client/src/components/tables/headers/IndicatorHeader.tsx b/client/src/components/tables/headers/IndicatorHeader.tsx index 7744ecd09..dcdfe68d7 100644 --- a/client/src/components/tables/headers/IndicatorHeader.tsx +++ b/client/src/components/tables/headers/IndicatorHeader.tsx @@ -1,8 +1,8 @@ +import { NumericSOV } from "util/sorts"; import { nanoid } from "nanoid"; import React from "react"; import { PBScoreDocument, ScoreDocument } from "tachi-common"; import { FolderDataset, PBDataset, ScoreDataset } from "types/tables"; -import { NumericSOV } from "util/sorts"; import { Header } from "../components/TachiTable"; const IndicatorHeader: Header = [ diff --git a/client/src/components/tables/history-scores/HistoryScoreTable.tsx b/client/src/components/tables/history-scores/HistoryScoreTable.tsx index 638b82f33..84df9b0a7 100644 --- a/client/src/components/tables/history-scores/HistoryScoreTable.tsx +++ b/client/src/components/tables/history-scores/HistoryScoreTable.tsx @@ -1,3 +1,4 @@ +import { NumericSOV } from "util/sorts"; import useScoreRatingAlg from "components/util/useScoreRatingAlg"; import React, { useState } from "react"; import { @@ -10,7 +11,6 @@ import { } from "tachi-common"; import { ScoreDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { NumericSOV } from "util/sorts"; import TimestampCell from "../cells/TimestampCell"; import TachiTable from "../components/TachiTable"; import ScoreCoreCells from "../game-core-cells/ScoreCoreCells"; diff --git a/client/src/components/tables/pbs/PBTable.tsx b/client/src/components/tables/pbs/PBTable.tsx index f72eb5114..cd558bef5 100644 --- a/client/src/components/tables/pbs/PBTable.tsx +++ b/client/src/components/tables/pbs/PBTable.tsx @@ -1,11 +1,11 @@ +import { NumericSOV } from "util/sorts"; +import { CreateDefaultPBSearchParams } from "util/tables/create-search"; +import { GetPBLeadingHeaders } from "util/tables/get-pb-leaders"; import useScoreRatingAlg from "components/util/useScoreRatingAlg"; import React, { useState } from "react"; import { Game, IDStrings, ScoreCalculatedDataLookup } from "tachi-common"; import { PBDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { NumericSOV } from "util/sorts"; -import { CreateDefaultPBSearchParams } from "util/tables/create-search"; -import { GetPBLeadingHeaders } from "util/tables/get-pb-leaders"; import IndexCell from "../cells/IndexCell"; import RankingCell from "../cells/RankingCell"; import TimestampCell from "../cells/TimestampCell"; diff --git a/client/src/components/tables/scores/ScoreTable.tsx b/client/src/components/tables/scores/ScoreTable.tsx index d6d9fb16f..131a18c1a 100644 --- a/client/src/components/tables/scores/ScoreTable.tsx +++ b/client/src/components/tables/scores/ScoreTable.tsx @@ -1,10 +1,10 @@ +import { NumericSOV, StrSOV } from "util/sorts"; +import { CreateDefaultScoreSearchParams } from "util/tables/create-search"; import useScoreRatingAlg from "components/util/useScoreRatingAlg"; import React, { useState } from "react"; import { Game, IDStrings, integer, ScoreCalculatedDataLookup } from "tachi-common"; import { ScoreDataset } from "types/tables"; import { Playtype } from "types/tachi"; -import { NumericSOV, StrSOV } from "util/sorts"; -import { CreateDefaultScoreSearchParams } from "util/tables/create-search"; import DifficultyCell from "../cells/DifficultyCell"; import IndicatorsCell from "../cells/IndicatorsCell"; import TimestampCell from "../cells/TimestampCell"; diff --git a/client/src/components/tables/sessions/GenericSessionTable.tsx b/client/src/components/tables/sessions/GenericSessionTable.tsx index 0ff94c10e..d688f9483 100644 --- a/client/src/components/tables/sessions/GenericSessionTable.tsx +++ b/client/src/components/tables/sessions/GenericSessionTable.tsx @@ -1,3 +1,7 @@ +import { GetPBs } from "util/data"; +import { UppercaseFirst } from "util/misc"; +import { NumericSOV, StrSOV } from "util/sorts"; +import { FormatDuration, FormatTime, MillisToSince } from "util/time"; import { useSessionRatingAlg } from "components/util/useScoreRatingAlg"; import React, { useState } from "react"; import { Link } from "react-router-dom"; @@ -11,10 +15,6 @@ import { SessionDocument, } from "tachi-common"; import { Playtype } from "types/tachi"; -import { GetPBs } from "util/data"; -import { UppercaseFirst } from "util/misc"; -import { NumericSOV, StrSOV } from "util/sorts"; -import { FormatDuration, FormatTime, MillisToSince } from "util/time"; import IndexCell from "../cells/IndexCell"; import SelectableRating from "../components/SelectableRating"; import TachiTable, { Header, ZTableTHProps } from "../components/TachiTable"; diff --git a/client/src/components/user/ProfilePicture.tsx b/client/src/components/user/ProfilePicture.tsx index 9168c7b54..b9d5372eb 100644 --- a/client/src/components/user/ProfilePicture.tsx +++ b/client/src/components/user/ProfilePicture.tsx @@ -1,6 +1,6 @@ +import { ToAPIURL } from "util/api"; import React from "react"; import { PublicUserDocument } from "tachi-common"; -import { ToAPIURL } from "util/api"; export default function ProfilePicture({ user, src }: { user: PublicUserDocument; src?: string }) { return ( diff --git a/client/src/components/user/UGPTHeader.tsx b/client/src/components/user/UGPTHeader.tsx index e3bc16a3c..fd0faacc1 100644 --- a/client/src/components/user/UGPTHeader.tsx +++ b/client/src/components/user/UGPTHeader.tsx @@ -1,3 +1,4 @@ +import { MillisToSince } from "util/time"; import Navbar from "components/nav/Navbar"; import NavItem from "components/nav/NavItem"; import MiniTable from "components/tables/components/MiniTable"; @@ -6,7 +7,6 @@ import React from "react"; import { Game, GetGamePTConfig, PublicUserDocument } from "tachi-common"; import { UGPTStatsReturn } from "types/api-returns"; import { Playtype } from "types/tachi"; -import { MillisToSince } from "util/time"; import ProfileBadges from "./ProfileBadges"; import ProfilePicture from "./ProfilePicture"; import RankingData from "./UGPTRankingData"; diff --git a/client/src/components/user/UGPTRankingData.tsx b/client/src/components/user/UGPTRankingData.tsx index 139cbd702..f30fcaa42 100644 --- a/client/src/components/user/UGPTRankingData.tsx +++ b/client/src/components/user/UGPTRankingData.tsx @@ -1,9 +1,9 @@ +import { UppercaseFirst } from "util/misc"; import { useProfileRatingAlg } from "components/util/useScoreRatingAlg"; import React from "react"; import { Link } from "react-router-dom"; import { IDStrings, integer, UGSRatingsLookup } from "tachi-common"; import { GamePT } from "types/react"; -import { UppercaseFirst } from "util/misc"; export default function RankingData({ rankingData, diff --git a/client/src/components/user/UGPTStatContainer.tsx b/client/src/components/user/UGPTStatContainer.tsx index 1b46d4853..bd60e39cf 100644 --- a/client/src/components/user/UGPTStatContainer.tsx +++ b/client/src/components/user/UGPTStatContainer.tsx @@ -1,3 +1,4 @@ +import { APIFetchV1 } from "util/api"; import Loading from "components/util/Loading"; import useApiQuery from "components/util/query/useApiQuery"; import { UserContext } from "context/UserContext"; @@ -6,7 +7,6 @@ import { useQuery } from "react-query"; import { integer, PublicUserDocument, ShowcaseStatDetails } from "tachi-common"; import { UGPTPreferenceStatsReturn } from "types/api-returns"; import { GamePT } from "types/react"; -import { APIFetchV1 } from "util/api"; import { StatDisplay } from "./UGPTStatShowcase"; type Props = { reqUser: PublicUserDocument } & GamePT; diff --git a/client/src/components/user/UGPTStatCreator.tsx b/client/src/components/user/UGPTStatCreator.tsx index f25c4dda6..7aa3aa525 100644 --- a/client/src/components/user/UGPTStatCreator.tsx +++ b/client/src/components/user/UGPTStatCreator.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { CreateSongMap } from "util/data"; import { useFormik } from "formik"; import React, { ChangeEventHandler, useEffect, useState } from "react"; import { Button, Form, Modal } from "react-bootstrap"; @@ -11,9 +13,7 @@ import { } from "tachi-common"; import { GamePT, SetState } from "types/react"; import { Playtype } from "types/tachi"; -import { APIFetchV1 } from "util/api"; import { SongChartsSearch } from "types/api-returns"; -import { CreateSongMap } from "util/data"; import DebounceSearch from "components/util/DebounceSearch"; interface Props { diff --git a/client/src/components/user/UGPTStatShowcase.tsx b/client/src/components/user/UGPTStatShowcase.tsx index 2f8f771ab..03d96297a 100644 --- a/client/src/components/user/UGPTStatShowcase.tsx +++ b/client/src/components/user/UGPTStatShowcase.tsx @@ -1,3 +1,6 @@ +import { APIFetchV1 } from "util/api"; +import { CreateChartLink } from "util/data"; +import { ToPercent, UppercaseFirst } from "util/misc"; import Card from "components/layout/page/Card"; import CardHeader from "components/layout/page/CardHeader"; import CardNavButton from "components/layout/page/CardNavButton"; @@ -24,9 +27,6 @@ import { import { UGPTPreferenceStatsReturn } from "types/api-returns"; import { GamePT } from "types/react"; import { Playtype } from "types/tachi"; -import { APIFetchV1 } from "util/api"; -import { CreateChartLink } from "util/data"; -import { ToPercent, UppercaseFirst } from "util/misc"; import UGPTStatContainer from "./UGPTStatContainer"; import UGPTStatCreator from "./UGPTStatCreator"; diff --git a/client/src/components/user/UGPTStatsOverview.tsx b/client/src/components/user/UGPTStatsOverview.tsx index 21f3456f7..125d21412 100644 --- a/client/src/components/user/UGPTStatsOverview.tsx +++ b/client/src/components/user/UGPTStatsOverview.tsx @@ -1,3 +1,4 @@ +import { FormatGPTRating, UppercaseFirst } from "util/misc"; import ClassBadge from "components/game/ClassBadge"; import QuickTooltip from "components/layout/misc/QuickTooltip"; import MiniTable from "components/tables/components/MiniTable"; @@ -12,7 +13,6 @@ import { UserGameStats, } from "tachi-common"; import { GameClassSets } from "tachi-common/js/game-classes"; -import { FormatGPTRating, UppercaseFirst } from "util/misc"; export default function UGPTRatingsTable({ ugs }: { ugs: UserGameStats }) { const gptConfig = GetGamePTConfig(ugs.game, ugs.playtype); diff --git a/client/src/components/user/UserHeader.tsx b/client/src/components/user/UserHeader.tsx index d309087a3..726bde00d 100644 --- a/client/src/components/user/UserHeader.tsx +++ b/client/src/components/user/UserHeader.tsx @@ -1,3 +1,5 @@ +import { APIFetchV1 } from "util/api"; +import { FormatDate } from "util/time"; import Navbar from "components/nav/Navbar"; import NavItem from "components/nav/NavItem"; import Divider from "components/util/Divider"; @@ -10,8 +12,6 @@ import React, { useContext, useState } from "react"; import { Button, Form, Modal } from "react-bootstrap"; import { PublicUserDocument } from "tachi-common"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; -import { FormatDate } from "util/time"; import ProfileBadges from "./ProfileBadges"; import ProfilePicture from "./ProfilePicture"; diff --git a/client/src/components/util/ApiError.tsx b/client/src/components/util/ApiError.tsx index d8f77d87f..ec32dd022 100644 --- a/client/src/components/util/ApiError.tsx +++ b/client/src/components/util/ApiError.tsx @@ -1,6 +1,6 @@ +import { UnsuccessfulAPIFetchResponse } from "util/api"; import { UserSettingsContext } from "context/UserSettingsContext"; import React, { useContext } from "react"; -import { UnsuccessfulAPIFetchResponse } from "util/api"; export default function ApiError({ error }: { error: UnsuccessfulAPIFetchResponse }) { const { settings } = useContext(UserSettingsContext); diff --git a/client/src/components/util/SelectLinkButton.tsx b/client/src/components/util/SelectLinkButton.tsx index 624c07984..69058c82a 100644 --- a/client/src/components/util/SelectLinkButton.tsx +++ b/client/src/components/util/SelectLinkButton.tsx @@ -1,7 +1,7 @@ +import { DoesMatchRoute } from "util/routing"; import React from "react"; import { ButtonVariant } from "react-bootstrap/esm/types"; import { JustChildren } from "types/react"; -import { DoesMatchRoute } from "util/routing"; import LinkButton from "./LinkButton"; export default function SelectLinkButton({ diff --git a/client/src/components/util/SiteWordmark.tsx b/client/src/components/util/SiteWordmark.tsx index 62422855b..b57b4fb0e 100644 --- a/client/src/components/util/SiteWordmark.tsx +++ b/client/src/components/util/SiteWordmark.tsx @@ -1,6 +1,6 @@ +import { ToCDNURL } from "util/api"; import { TachiConfig } from "lib/config"; import React from "react"; -import { ToCDNURL } from "util/api"; export default function SiteWordmark({ width = "256px" }) { return ( diff --git a/client/src/components/util/UpdateUserGameStats.tsx b/client/src/components/util/UpdateUserGameStats.tsx index 2a0271c72..12237d76f 100644 --- a/client/src/components/util/UpdateUserGameStats.tsx +++ b/client/src/components/util/UpdateUserGameStats.tsx @@ -1,6 +1,6 @@ +import { APIFetchV1 } from "util/api"; import { UserGameStats } from "tachi-common"; import { SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; export default async function UpdateUserGameStats(setUGS: SetState) { const res = await APIFetchV1("/users/me/game-stats"); diff --git a/client/src/components/util/import/useImport.ts b/client/src/components/util/import/useImport.ts index d39ddfa26..5a63b57a5 100644 --- a/client/src/components/util/import/useImport.ts +++ b/client/src/components/util/import/useImport.ts @@ -1,9 +1,9 @@ /* eslint-disable no-await-in-loop */ +import { APIFetchV1 } from "util/api"; +import { Sleep } from "util/misc"; import { useState } from "react"; import { ImportDocument, integer } from "tachi-common"; import { ImportStates, NotStartedState } from "types/import"; -import { APIFetchV1 } from "util/api"; -import { Sleep } from "util/misc"; export interface ImportDeferred { url: string; diff --git a/client/src/components/util/query/useApiQuery.tsx b/client/src/components/util/query/useApiQuery.tsx index dc3618b32..f29be0aee 100644 --- a/client/src/components/util/query/useApiQuery.tsx +++ b/client/src/components/util/query/useApiQuery.tsx @@ -1,6 +1,6 @@ +import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; import { useQuery } from "react-query"; import { SuccessfulAPIResponse } from "tachi-common"; -import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api"; export default function useApiQuery( url: string | string[], diff --git a/client/src/components/util/useSplashText.tsx b/client/src/components/util/useSplashText.tsx index ea58a5ad2..4245acc02 100644 --- a/client/src/components/util/useSplashText.tsx +++ b/client/src/components/util/useSplashText.tsx @@ -1,7 +1,7 @@ -import { UserSettingsContext } from "context/UserSettingsContext"; -import { useContext } from "react"; import { RFA } from "util/misc"; import { contentiousSplashes, loggedInSplashes, neutralSplashes } from "util/splashes"; +import { UserSettingsContext } from "context/UserSettingsContext"; +import { useContext } from "react"; export default function useSplashText() { const { settings } = useContext(UserSettingsContext); diff --git a/client/src/context/BackgroundContext.tsx b/client/src/context/BackgroundContext.tsx index a3fbd4a02..75ed3822b 100644 --- a/client/src/context/BackgroundContext.tsx +++ b/client/src/context/BackgroundContext.tsx @@ -1,6 +1,6 @@ +import { NO_OP } from "util/misc"; import React, { createContext, useState } from "react"; import { JustChildren, SetState } from "types/react"; -import { NO_OP } from "util/misc"; export const BackgroundContext = createContext<{ background: string | null; diff --git a/client/src/context/SubheaderContext.tsx b/client/src/context/SubheaderContext.tsx index 05c6417f7..7196464b6 100644 --- a/client/src/context/SubheaderContext.tsx +++ b/client/src/context/SubheaderContext.tsx @@ -1,6 +1,6 @@ +import { NO_OP } from "util/misc"; import React, { createContext, useState } from "react"; import { JustChildren, SetState } from "types/react"; -import { NO_OP } from "util/misc"; export const SubheaderContext = createContext({ title: "", diff --git a/client/src/context/UserSettingsContext.tsx b/client/src/context/UserSettingsContext.tsx index ff15fd3a9..968c3eaa6 100644 --- a/client/src/context/UserSettingsContext.tsx +++ b/client/src/context/UserSettingsContext.tsx @@ -1,7 +1,7 @@ +import { APIFetchV1 } from "util/api"; import React, { createContext, useContext, useEffect, useState } from "react"; import { UserSettings } from "tachi-common"; import { JustChildren, SetState } from "types/react"; -import { APIFetchV1 } from "util/api"; import { UserContext } from "./UserContext"; /** diff --git a/client/src/lib/config.ts b/client/src/lib/config.ts index 1959d80ba..23f16a7b1 100644 --- a/client/src/lib/config.ts +++ b/client/src/lib/config.ts @@ -1,8 +1,7 @@ +import { ToAPIURL } from "util/api"; import { Game, ImportTypes } from "tachi-common"; -import { allImportTypes, allSupportedGames } from "tachi-common/js/config/static-config"; // @ts-expect-error No types available... import syncFetch from "sync-fetch"; -import { ToAPIURL } from "util/api"; export const mode = process.env.REACT_APP_TCHIC_MODE; diff --git a/client/src/util/misc.ts b/client/src/util/misc.ts index 6020d4461..9fc11f78b 100644 --- a/client/src/util/misc.ts +++ b/client/src/util/misc.ts @@ -288,5 +288,5 @@ export function TruncateString(string: string, len = 30) { return string; } - return `${string.slice(len - 3)}...`; + return `${string.substring(0, len - 3)}...`; } diff --git a/client/src/util/tables/create-search.ts b/client/src/util/tables/create-search.ts index e3ebf2859..d02b2885b 100644 --- a/client/src/util/tables/create-search.ts +++ b/client/src/util/tables/create-search.ts @@ -1,9 +1,9 @@ -import { ChartDocument, Game, GamePTConfig, GetGamePTConfig, IDStrings } from "tachi-common"; -import { FolderDataset, PBDataset, ScoreDataset } from "types/tables"; -import { Playtype } from "types/tachi"; import { BMS_TABLES } from "util/constants/bms-tables"; import { HumanFriendlyStrToGradeIndex, HumanFriendlyStrToLampIndex } from "util/str-to-num"; import { ValueGetterOrHybrid } from "util/ztable/search"; +import { ChartDocument, Game, GamePTConfig, GetGamePTConfig, IDStrings } from "tachi-common"; +import { FolderDataset, PBDataset, ScoreDataset } from "types/tables"; +import { Playtype } from "types/tachi"; function GetBMSTableVal(chart: ChartDocument<"bms:7K" | "bms:14K">, key: string) { for (const table of chart.data.tableFolders) { diff --git a/client/src/util/tables/get-pb-leaders.ts b/client/src/util/tables/get-pb-leaders.ts index 098367fcc..ebf32790f 100644 --- a/client/src/util/tables/get-pb-leaders.ts +++ b/client/src/util/tables/get-pb-leaders.ts @@ -1,7 +1,7 @@ +import { StrSOV } from "util/sorts"; import { Header } from "components/tables/components/TachiTable"; import IndicatorHeader from "components/tables/headers/IndicatorHeader"; import { PBDataset } from "types/tables"; -import { StrSOV } from "util/sorts"; type PBHeader = Header; diff --git a/client/src/util/ztable/search.ts b/client/src/util/ztable/search.ts index 84eb7eb51..93aa99892 100644 --- a/client/src/util/ztable/search.ts +++ b/client/src/util/ztable/search.ts @@ -1,5 +1,5 @@ -import { ZTableSearchFn } from "components/util/table/useZTable"; import { SEARCH_DIRECTIVES } from "util/constants/search-directives"; +import { ZTableSearchFn } from "components/util/table/useZTable"; export interface SearchDirective { key: string;