Skip to content

Commit

Permalink
chore: eslint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-psi committed Oct 25, 2023
1 parent 34f86b9 commit cba109d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
6 changes: 2 additions & 4 deletions client/src/app/pages/dashboard/import/ImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ function ImportInfoDisplayer({ game }: { game: Game }) {
/>
);
} else if (game === "maimai") {
Content.unshift(
<ImportTypeInfoCard key="api/myt-maimai" importType="api/myt-maimai" />,
);
Content.unshift(<ImportTypeInfoCard key="api/myt-maimai" importType="api/myt-maimai" />);
} else if (game === "maimaidx") {
Content.unshift(
<ImportInfoCard
Expand Down Expand Up @@ -482,7 +480,7 @@ function ImportTypeInfoCard({
);
case "api/myt-maimai":
return (
<ImportInfoCard
<ImportInfoCard
name="MYT Integration"
href="myt-maimai"
desc="Pull your maimai scores from the MYT network."
Expand Down
9 changes: 4 additions & 5 deletions client/src/app/pages/dashboard/import/MikadoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export default function MikadoPage() {
<div>
<h1 className="text-center mb-4">What Is Mikado?</h1>
<div>
Mikado is a <code>.dll</code> file that hooks into SDVX and automatically sends
the scores to a server. {TachiConfig.name} is compatible with what Mikado sends,
so you can use it to submit scores!
Mikado is a <code>.dll</code> file that hooks into SDVX and automatically sends the
scores to a server. {TachiConfig.name} is compatible with what Mikado sends, so you
can use it to submit scores!
</div>
<Divider />
<h1 className="text-center my-4">Setup Instructions</h1>
Expand All @@ -39,8 +39,7 @@ export default function MikadoPage() {
</li>
<ul className="instructions-list">
<li>
BemaniTools: Add <code>-K mikado.dll</code> to your <code>.bat</code>{" "}
file.
BemaniTools: Add <code>-K mikado.dll</code> to your <code>.bat</code> file.
</li>
<li>
SpiceTools: Add <code>-k mikado.dll</code> to your <code>.bat</code> file.
Expand Down
10 changes: 5 additions & 5 deletions client/src/app/pages/dashboard/users/UserIntegrationsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
} from "tachi-common";
import { SetState } from "types/react";
import { CGNeedsIntegrate } from "components/imports/CGIntegrationPage";
import { MYTNeedsIntegrate } from "components/imports/MYTIntegrationPage";
import FervidexIntegrationPage from "./FervidexIntegrationPage";
import KsHookSV6CIntegrationPage from "./KsHookSV6CIntegrationPage";
import { MYTNeedsIntegrate } from "components/imports/MYTIntegrationPage";

export default function UserIntegrationsPage({ reqUser }: { reqUser: UserDocument }) {
useSetSubheader(
Expand Down Expand Up @@ -995,10 +995,10 @@ function CGIntegrationInfo({ cgType, userID }: { cgType: "dev" | "gan" | "nag";
function MYTIntegrationInfo({ userID }: { userID: integer }) {
const [reload, shouldReloadAuthInfo] = useReducer((x) => x + 1, 0);

const { data, error } = useApiQuery<{ authStatus: boolean; }>(
const { data, error } = useApiQuery<{ authStatus: boolean }>(
`/users/${userID}/integrations/myt`,
undefined,
[reload],
[reload]
);

if (error) {
Expand All @@ -1023,13 +1023,13 @@ function MYTIntegrationInfo({ userID }: { userID: integer }) {
},
},
true,
true,
true
);

if (res.success) {
shouldReloadAuthInfo();
}
}}
/>
)
);
}
33 changes: 14 additions & 19 deletions client/src/components/imports/MYTIntegrationPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { APIFetchV1 } from "util/api";
import { ErrorPage } from "app/pages/ErrorPage";
import useSetSubheader from "components/layout/header/useSetSubheader";
import ApiError from "components/util/ApiError";
Expand All @@ -12,7 +13,6 @@ import React, { useContext, useReducer, useState } from "react";
import { Form, Button } from "react-bootstrap";
import { APIImportTypes, GetGameConfig, MYTAuthDocument } from "tachi-common";
import { SetState } from "types/react";
import { APIFetchV1 } from "util/api";
import ImportStateRenderer from "./ImportStateRenderer";

export default function MYTIntegrationPage() {
Expand All @@ -29,7 +29,7 @@ export default function MYTIntegrationPage() {
return <ErrorPage statusCode={401} />;
}

const { data, error } = useApiQuery<{ authStatus: boolean; }>(
const { data, error } = useApiQuery<{ authStatus: boolean }>(
`/users/${user.id}/integrations/myt`,
undefined,
[reload]
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function MYTIntegrationPage() {
},
},
true,
true,
true
);

if (res.success) {
Expand All @@ -71,51 +71,46 @@ export default function MYTIntegrationPage() {
<Divider />
</>
)}
{data && (
<MYTImporter
showEdit={showEdit}
setShowEdit={setShowEdit}
/>
)}
{data && <MYTImporter showEdit={showEdit} setShowEdit={setShowEdit} />}
</>
)
);
}

export function MYTNeedsIntegrate({
authStatus,
onSubmit,
}: {
authStatus?: boolean,
authStatus?: boolean;
onSubmit: (authToken: string) => Promise<void>;
}) {
const [authToken, setAuthToken] = useState("");

return (
<div>
<h3 className="text-center mb-4">{authStatus ? "Update " : "Set "} your MYT authentication token.</h3>
<h3 className="text-center mb-4">
{authStatus ? "Update " : "Set "} your MYT authentication token.
</h3>

<FormInput fieldName="Token" setValue={setAuthToken} value={authToken} />
<Form.Label>
You can retrieve a token by visiting your account profile on the MYT web portal.
You can retrieve a token by visiting your account profile on the MYT web portal.
</Form.Label>

<Divider />

<div className="w-100 d-flex justify-content-center">
<Button onClick={() => onSubmit(authToken)}>
Submit Token
</Button>
<Button onClick={() => onSubmit(authToken)}>Submit Token</Button>
</div>
</div>
)
);
}

function MYTImporter({
showEdit,
setShowEdit,
}: {
showEdit: boolean,
setShowEdit: SetState<boolean>,
showEdit: boolean;
setShowEdit: SetState<boolean>;
}) {
const importType: APIImportTypes = "api/myt-maimai";

Expand Down

0 comments on commit cba109d

Please sign in to comment.