From c7150f1e23336fbc10f8e99b7e1b6208325cb0ec Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Apr 2025 16:59:01 -0700 Subject: [PATCH 1/4] web: fix mapfixes cards linking to submissions --- web/src/app/_components/mapCard.tsx | 31 ++++++++++++++++++++++++++++- web/src/app/mapfixes/page.tsx | 2 +- web/src/app/submissions/page.tsx | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/web/src/app/_components/mapCard.tsx b/web/src/app/_components/mapCard.tsx index 3e4269a..539c08e 100644 --- a/web/src/app/_components/mapCard.tsx +++ b/web/src/app/_components/mapCard.tsx @@ -12,7 +12,7 @@ interface SubmissionCardProps { id: number; } -export default function SubmissionCard(props: SubmissionCardProps) { +export function SubmissionCard(props: SubmissionCardProps) { return (
@@ -40,3 +40,32 @@ export default function SubmissionCard(props: SubmissionCardProps) { ); } + +export function MapfixCard(props: SubmissionCardProps) { + return ( + +
+
+
+ {/* TODO: Grab image of model */} + {props.displayName} +
+
+
+ {props.displayName} +
+ +
+
+
+
+ {props.author}/ + {props.author} +
+
+
+
+
+ + ); +} diff --git a/web/src/app/mapfixes/page.tsx b/web/src/app/mapfixes/page.tsx index 743062d..37f232b 100644 --- a/web/src/app/mapfixes/page.tsx +++ b/web/src/app/mapfixes/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import { MapfixInfo } from "../ts/Mapfix"; -import MapfixCard from "../_components/mapCard"; +import { MapfixCard } from "../_components/mapCard"; import Webpage from "@/app/_components/webpage"; // TODO: MAKE MAPFIX & SUBMISSIONS USE THE SAME COMPONENTS :angry: (currently too lazy) diff --git a/web/src/app/submissions/page.tsx b/web/src/app/submissions/page.tsx index 05d3ce7..05b877c 100644 --- a/web/src/app/submissions/page.tsx +++ b/web/src/app/submissions/page.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import { SubmissionInfo } from "../ts/Submission"; -import SubmissionCard from "../_components/mapCard"; +import { SubmissionCard } from "../_components/mapCard"; import Webpage from "@/app/_components/webpage"; import "./(styles)/page.scss"; -- 2.49.1 From c50a28443ed8d70cb132ad44c4960f90d669a805 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Apr 2025 17:01:43 -0700 Subject: [PATCH 2/4] web: remove ratings --- web/src/app/mapfixes/[mapfixId]/page.tsx | 24 ------------------- .../app/submissions/[submissionId]/page.tsx | 24 ------------------- 2 files changed, 48 deletions(-) diff --git a/web/src/app/mapfixes/[mapfixId]/page.tsx b/web/src/app/mapfixes/[mapfixId]/page.tsx index 43d3f2e..7ddeacb 100644 --- a/web/src/app/mapfixes/[mapfixId]/page.tsx +++ b/web/src/app/mapfixes/[mapfixId]/page.tsx @@ -5,10 +5,8 @@ import type { CreatorAndReviewStatus } from "./_comments"; import { MapImage } from "./_map"; import { useParams } from "next/navigation"; import ReviewButtons from "./_reviewButtons"; -import { Rating } from "@mui/material"; import Comments from "./_comments"; import Webpage from "@/app/_components/webpage"; -import Window from "./_window"; import Link from "next/link"; import { useState, useEffect } from "react"; @@ -20,34 +18,12 @@ interface ReviewId { mapfixSubmitter: number, } -function Ratings() { - return ( - -
- - -
-
- ) -} - function RatingArea(mapfix: ReviewId) { return ( ) diff --git a/web/src/app/submissions/[submissionId]/page.tsx b/web/src/app/submissions/[submissionId]/page.tsx index 9b8d4d1..6d08bce 100644 --- a/web/src/app/submissions/[submissionId]/page.tsx +++ b/web/src/app/submissions/[submissionId]/page.tsx @@ -5,10 +5,8 @@ import type { CreatorAndReviewStatus } from "./_comments"; import { MapImage } from "./_mapImage"; import { useParams } from "next/navigation"; import ReviewButtons from "./_reviewButtons"; -import { Rating } from "@mui/material"; import Comments from "./_comments"; import Webpage from "@/app/_components/webpage"; -import Window from "./_window"; import Link from "next/link"; import { useState, useEffect } from "react"; @@ -21,34 +19,12 @@ interface ReviewId { submissionSubmitter: number, } -function Ratings() { - return ( - -
- - -
-
- ) -} - function RatingArea(submission: ReviewId) { return ( ) -- 2.49.1 From f73c274367c0befe1bc604ee0797325f22ad7efe Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Apr 2025 17:11:32 -0700 Subject: [PATCH 3/4] web: move _map to _mapImage --- web/src/app/mapfixes/[mapfixId]/{_map.tsx => _mapImage.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename web/src/app/mapfixes/[mapfixId]/{_map.tsx => _mapImage.tsx} (100%) diff --git a/web/src/app/mapfixes/[mapfixId]/_map.tsx b/web/src/app/mapfixes/[mapfixId]/_mapImage.tsx similarity index 100% rename from web/src/app/mapfixes/[mapfixId]/_map.tsx rename to web/src/app/mapfixes/[mapfixId]/_mapImage.tsx -- 2.49.1 From 9372caa1575c280940a768756331b5c1e483caa1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 4 Apr 2025 17:11:41 -0700 Subject: [PATCH 4/4] web: fix mapfix thumbnails --- web/src/app/mapfixes/[mapfixId]/_mapImage.tsx | 21 +++++++++++++++++-- web/src/app/mapfixes/[mapfixId]/page.tsx | 7 ++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/web/src/app/mapfixes/[mapfixId]/_mapImage.tsx b/web/src/app/mapfixes/[mapfixId]/_mapImage.tsx index f515db2..d82f482 100644 --- a/web/src/app/mapfixes/[mapfixId]/_mapImage.tsx +++ b/web/src/app/mapfixes/[mapfixId]/_mapImage.tsx @@ -1,11 +1,28 @@ +import Image from "next/image"; import { MapfixInfo } from "@/app/ts/Mapfix" interface AssetID { id: MapfixInfo["AssetID"] } -function MapImage() { - return

Fetching map image...

+function MapImage({ id }: AssetID) { + if (!id) { + return

Missing asset ID

; + } + + const imageUrl = `/thumbnails/asset/${id}`; + + return ( + Map Thumbnail + ); } export { diff --git a/web/src/app/mapfixes/[mapfixId]/page.tsx b/web/src/app/mapfixes/[mapfixId]/page.tsx index 7ddeacb..6a1828a 100644 --- a/web/src/app/mapfixes/[mapfixId]/page.tsx +++ b/web/src/app/mapfixes/[mapfixId]/page.tsx @@ -2,7 +2,7 @@ import { MapfixInfo, MapfixStatusToString } from "@/app/ts/Mapfix"; import type { CreatorAndReviewStatus } from "./_comments"; -import { MapImage } from "./_map"; +import { MapImage } from "./_mapImage"; import { useParams } from "next/navigation"; import ReviewButtons from "./_reviewButtons"; import Comments from "./_comments"; @@ -16,13 +16,14 @@ interface ReviewId { mapfixId: string, mapfixStatus: number; mapfixSubmitter: number, + mapfixAssetId: number; } function RatingArea(mapfix: ReviewId) { return ( @@ -74,7 +75,7 @@ export default function MapfixInfoPage() {
- +
-- 2.49.1