From c346e192cbcdb007def2f461e00d23bb619fc847 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 1 Apr 2025 15:55:52 -0700 Subject: [PATCH 01/18] web: remove all fields from submission forms except Asset ID --- web/src/app/maps/[mapId]/fix/_game.tsx | 65 -------------------------- web/src/app/maps/[mapId]/fix/page.tsx | 15 ------ web/src/app/submit/_game.tsx | 65 -------------------------- web/src/app/submit/page.tsx | 16 ------- 4 files changed, 161 deletions(-) delete mode 100644 web/src/app/maps/[mapId]/fix/_game.tsx delete mode 100644 web/src/app/submit/_game.tsx diff --git a/web/src/app/maps/[mapId]/fix/_game.tsx b/web/src/app/maps/[mapId]/fix/_game.tsx deleted file mode 100644 index e754601..0000000 --- a/web/src/app/maps/[mapId]/fix/_game.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { FormControl, Select, InputLabel, MenuItem } from "@mui/material"; -import { styled } from '@mui/material/styles'; -import InputBase from '@mui/material/InputBase'; -import React from "react"; -import { SelectChangeEvent } from "@mui/material"; - -// TODO: Properly style everything instead of pasting 🤚 - -type GameSelectionProps = { - game: number; - setGame: React.Dispatch>; -}; - -const BootstrapInput = styled(InputBase)(({ theme }) => ({ - 'label + &': { - marginTop: theme.spacing(3), - }, - '& .MuiInputBase-input': { - backgroundColor: '#0000', - color: '#FFF', - border: '1px solid rgba(175, 175, 175, 0.66)', - fontSize: 16, - padding: '10px 26px 10px 12px', - transition: theme.transitions.create(['border-color', 'box-shadow']), - fontFamily: [ - '-apple-system', - 'BlinkMacSystemFont', - '"Segoe UI"', - 'Roboto', - '"Helvetica Neue"', - 'Arial', - 'sans-serif', - '"Apple Color Emoji"', - '"Segoe UI Emoji"', - '"Segoe UI Symbol"', - ].join(','), - '&:focus': { - borderRadius: 4, - borderColor: '#80bdff', - boxShadow: '0 0 0 0.2rem rgba(0,123,255,.25)', - }, - }, - })); - -export default function GameSelection({ game, setGame }: GameSelectionProps) { - const handleChange = (event: SelectChangeEvent) => { - setGame(Number(event.target.value)); // TODO: Change later!! there's 100% a proper way of doing this - }; - - return ( - - Game - - - ); -} \ No newline at end of file diff --git a/web/src/app/maps/[mapId]/fix/page.tsx b/web/src/app/maps/[mapId]/fix/page.tsx index 5e68374..7408e43 100644 --- a/web/src/app/maps/[mapId]/fix/page.tsx +++ b/web/src/app/maps/[mapId]/fix/page.tsx @@ -2,20 +2,14 @@ import { Button, TextField } from "@mui/material" -import GameSelection from "./_game"; import SendIcon from '@mui/icons-material/Send'; import Webpage from "@/app/_components/webpage"; import { useParams } from "next/navigation"; -import React, { useState } from "react"; import "./(styles)/page.scss" interface MapfixPayload { - DisplayName: string; - Creator: string; - GameID: number; AssetID: number; - AssetVersion: number; TargetAssetID: number; } interface IdResponse { @@ -23,7 +17,6 @@ interface IdResponse { } export default function MapfixInfoPage() { - const [game, setGame] = useState(1); const dynamicId = useParams<{ mapId: string }>(); const handleSubmit = async (event: React.FormEvent) => { @@ -33,11 +26,7 @@ export default function MapfixInfoPage() { const formData = new FormData(form); const payload: MapfixPayload = { - DisplayName: (formData.get("display-name") as string) ?? "unknown", // TEMPORARY! TODO: Change - Creator: (formData.get("creator") as string) ?? "unknown", // TEMPORARY! TODO: Change - GameID: game, AssetID: Number((formData.get("asset-id") as string) ?? "0"), - AssetVersion: 0, TargetAssetID: Number(dynamicId.mapId), }; @@ -80,11 +69,7 @@ export default function MapfixInfoPage() {
{/* TODO: Add form data for mapfixes, such as changes they did, and any times that need to be deleted & what styles */} - - - {/* I think this is Quat's job to figure this one out (to be set when someone clicks review(?)) */} {/* */} -