New formatting
This commit is contained in:
@ -23,7 +23,7 @@ import { useEffect, useState } from "react";
|
||||
|
||||
export default function (props: AppealCardProps) {
|
||||
const [dateString, setDateString] = useState(
|
||||
new Date(props.created_at).toUTCString()
|
||||
new Date(props.created_at).toUTCString(),
|
||||
);
|
||||
const [action, setAction] = useState("");
|
||||
const [feedback, setFeedback] = useState("");
|
||||
|
@ -49,7 +49,7 @@ export default function ({
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
id: string,
|
||||
value: string
|
||||
value: string,
|
||||
) {
|
||||
const newState = { ...state };
|
||||
newState[id] = value;
|
||||
@ -60,7 +60,7 @@ export default function ({
|
||||
function renderCheckboxOptions(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for checkbox are undefined");
|
||||
|
||||
@ -88,7 +88,7 @@ export default function ({
|
||||
? groupValues.push(e.target.value)
|
||||
: groupValues.splice(
|
||||
groupValues.findIndex((v) => v === e.target.value),
|
||||
1
|
||||
1,
|
||||
);
|
||||
|
||||
newState[c.id] = groupValues;
|
||||
@ -97,7 +97,7 @@ export default function ({
|
||||
value={option.value}
|
||||
>
|
||||
{option.value}
|
||||
</Checkbox>
|
||||
</Checkbox>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ export default function ({
|
||||
function renderRadioElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for radio buttons are undefined!");
|
||||
const buttons = [];
|
||||
@ -120,7 +120,7 @@ export default function ({
|
||||
buttons.push(
|
||||
<Radio checked={option.default} value={option.value}>
|
||||
{option.value}
|
||||
</Radio>
|
||||
</Radio>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ export default function ({
|
||||
function renderSelectElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for select are undefined!");
|
||||
|
||||
@ -170,14 +170,14 @@ export default function ({
|
||||
function generateReactComponents(
|
||||
components: component[],
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
): JSX.Element[] {
|
||||
const fragmentsList = [];
|
||||
|
||||
for (const component of components) {
|
||||
fragmentsList.push(
|
||||
<Heading size="md">{component.title}</Heading>,
|
||||
<br />
|
||||
<br />,
|
||||
);
|
||||
|
||||
switch (component.type) {
|
||||
@ -204,7 +204,7 @@ export default function ({
|
||||
value={component.value}
|
||||
/>
|
||||
<FormErrorMessage>Field is required</FormErrorMessage>
|
||||
</FormControl>
|
||||
</FormControl>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -212,7 +212,7 @@ export default function ({
|
||||
fragmentsList.push(
|
||||
<NumberInput
|
||||
isInvalid={isNumberElemInvalid(
|
||||
document.getElementById(component.id) as HTMLInputElement
|
||||
document.getElementById(component.id) as HTMLInputElement,
|
||||
)}
|
||||
isReadOnly={read_only}
|
||||
>
|
||||
@ -227,7 +227,7 @@ export default function ({
|
||||
<NumberIncrementStepper />
|
||||
<NumberDecrementStepper />
|
||||
</NumberInputStepper>
|
||||
</NumberInput>
|
||||
</NumberInput>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -256,7 +256,7 @@ export default function ({
|
||||
style={{ display: page ? "none" : undefined }}
|
||||
>
|
||||
{generateReactComponents(componentList, responses, setResponses)}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
||||
export default function (props: GameAppealProps) {
|
||||
async function performAction(action: "accept" | "deny"): Promise<void> {
|
||||
const statsReduction = parseInt(
|
||||
(document.getElementById("reductPercentage") as HTMLInputElement).value
|
||||
(document.getElementById("reductPercentage") as HTMLInputElement).value,
|
||||
);
|
||||
|
||||
const actionResponse = await fetch(`/api/game-appeals/${props.roblox_id}`, {
|
||||
@ -49,7 +49,7 @@ export default function (props: GameAppealProps) {
|
||||
duration: 10000,
|
||||
status: "error",
|
||||
title: "An error occurred...",
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,9 @@ export default function (props: {
|
||||
<Link href="/support" size="lg">
|
||||
Support
|
||||
</Link>
|
||||
<Link href="https://ccdiscussion.com" size="lg">
|
||||
Community
|
||||
</Link>
|
||||
<Link
|
||||
display={hasMod() ? undefined : "none"}
|
||||
href="/mod-queue"
|
||||
|
@ -18,7 +18,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
|
||||
if (!props.isOpen) return;
|
||||
|
||||
const evidenceElement = document.getElementById(
|
||||
"evidence"
|
||||
"evidence",
|
||||
) as HTMLInputElement;
|
||||
|
||||
if (!evidenceElement.files && e.clipboardData?.files) {
|
||||
|
Reference in New Issue
Block a user