diff --git a/web/src/app/submissions/_card.tsx b/web/src/app/submissions/_card.tsx
index 5446573..a58fdb9 100644
--- a/web/src/app/submissions/_card.tsx
+++ b/web/src/app/submissions/_card.tsx
@@ -2,7 +2,15 @@ import React from "react";
import Image from "next/image";
import Link from "next/link";
-export default function SubmissionCard({ id, displayName, author, rating }) {
+interface SubmissionCardProps {
+ id: number;
+ assetId: number;
+ displayName: string;
+ author: string;
+ rating: number;
+}
+
+export default function SubmissionCard({ id, displayName, author, rating }: SubmissionCardProps) {
return (
diff --git a/web/src/app/submissions/page.tsx b/web/src/app/submissions/page.tsx
index 57ba65a..866e2e6 100644
--- a/web/src/app/submissions/page.tsx
+++ b/web/src/app/submissions/page.tsx
@@ -7,9 +7,10 @@ import SubmissionCard from "./_card";
import SkeletonGrid from './_loading';
import "./(styles)/page.scss";
+import { SubmissionInfo } from '../ts/Submission';
export default function SubmissionInfoPage() {
- const [submissions, setSubmissions] = useState(null)
+ const [submissions, setSubmissions] = useState([])
useEffect(() => { // needs to be client sided since server doesn't have a session, nextjs got mad at me for exporting an async function: (https://nextjs.org/docs/messages/no-async-client-component)
async function fetchSubmissions() {
@@ -45,7 +46,7 @@ export default function SubmissionInfoPage() {
>;
+ game: number;
+ setGame: React.Dispatch>;
};
const BootstrapInput = styled(InputBase)(({ theme }) => ({
@@ -44,14 +45,14 @@ const BootstrapInput = styled(InputBase)(({ theme }) => ({
export default function GameSelection({ game, setGame }: GameSelectionProps) {
const handleChange = (event: SelectChangeEvent) => {
- setGame(event.target.value);
+ setGame(Number(event.target.value)); // TODO: Change later!! there's 100% a proper way of doing this
};
return (
Game
}
diff --git a/web/src/app/submit/page.tsx b/web/src/app/submit/page.tsx
index 06207d4..e098741 100644
--- a/web/src/app/submit/page.tsx
+++ b/web/src/app/submit/page.tsx
@@ -1,11 +1,10 @@
"use client"
-import { FormControl, FormLabel, RadioGroup, FormControlLabel, Button, TextField, Checkbox } from "@mui/material"
+import { FormControl, FormControlLabel, Button, TextField, Checkbox } from "@mui/material"
import GameSelection from "./_game";
import SendIcon from '@mui/icons-material/Send';
import Webpage from "@/app/_components/webpage"
-import Radio from '@mui/material/Radio';
import React, { useState } from "react";
import "./(styles)/page.scss"
@@ -16,23 +15,7 @@ interface SubmissionPayload {
GameID: number;
AssetID: number;
AssetVersion: number;
- Submitter: number;
SubmissionType: number;
- }
-
-const enum Map {
- New,
- Fix,
-}
-
-function TargetAsset() {
- return (
- Target:
-
- } label="New"/>
- } label="Fix"/>
-
- )
}
export default function SubmissionInfoPage() {
@@ -44,23 +27,14 @@ export default function SubmissionInfoPage() {
const form = event.currentTarget;
const formData = new FormData(form);
- const data = {
- displayName: formData.get("display-name"),
- creator: formData.get("creator"),
- assetId: formData.get("asset-id"),
- game,
- isFixingMap,
- };
-
- console.log(data)
const payload: SubmissionPayload = {
- DisplayName: data.displayName,
- Creator: data.creator,
+ DisplayName: (formData.get("display-name") as string) ?? "unknown", // TEMPORARY! TODO: Change
+ Creator: (formData.get("creator") as string) ?? "unknown", // TEMPORARY! TODO: Change
GameID: 1073741824, // TODO: Change this!!
- AssetID: Number(data.assetId),
+ AssetID: Number((formData.get("asset-id") as string) ?? "0"),
AssetVersion: 0,
- SubmissionType: 1,
+ SubmissionType: isFixingMap ? 2 : 1,
};
console.log(payload)