-
+
);
diff --git a/pages/report/incident.js b/pages/report/incident.js
deleted file mode 100644
index 7a6122c..0000000
--- a/pages/report/incident.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import { useRouter } from "next/router";
-import { useForm } from "react-hook-form";
-import Meta from "../../components/meta";
-
-export default function IncidentPage() {
- const { query } = useRouter();
- const userId = query.userId;
- const reportedUserId = query.reportedUserId;
- const reportedGroupId = query.reportedGroupId;
-
- const { register, handleSubmit, formState } = useForm();
-
- const { isSubmitting } = formState;
-
- const onSubmit = async (data) => {
- try {
- await fetch("/api/report/create", {
- method: "POST",
- body: JSON.stringify(data),
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json",
- },
- });
-
- window.location.replace("/report/received");
- } catch (error) {
- console.error(error);
- window.alert("Something went wrong submitting your report");
- }
- };
-
- return (
-
- }
- url="https://soapbox.social/report/incident"
- />
-
-
-
- );
-}
diff --git a/pages/report/incident.tsx b/pages/report/incident.tsx
new file mode 100644
index 0000000..186e56c
--- /dev/null
+++ b/pages/report/incident.tsx
@@ -0,0 +1,249 @@
+import { useRouter } from "next/router";
+import { SubmitHandler, useForm } from "react-hook-form";
+import Meta from "../../components/meta";
+
+type FormValues = {
+ userId?: string;
+ reportedUserId?: string;
+ reportedGroupId?: string;
+ email: string;
+ name: string;
+ what: string;
+ subject: string;
+ details: string;
+ reportIsCorrect: boolean;
+};
+
+export default function IncidentPage() {
+ const { query } = useRouter();
+
+ const userId = query.userId;
+ const reportedUserId = query.reportedUserId;
+ const reportedGroupId = query.reportedGroupId;
+
+ const { register, handleSubmit, formState } = useForm
();
+
+ const { isSubmitting } = formState;
+
+ const onSubmit: SubmitHandler = async (data) => {
+ try {
+ await fetch("/api/report/create", {
+ method: "POST",
+ body: JSON.stringify(data),
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ },
+ });
+
+ window.location.replace("/report/received");
+ } catch (error) {
+ console.error(error);
+ window.alert("Something went wrong submitting your report");
+ }
+ };
+
+ return (
+
+ }
+ url="https://soapbox.social/report/incident"
+ />
+
+
+
+
+
+ );
+}
diff --git a/pages/report/received.tsx b/pages/report/received.tsx
index 2052198..87818dc 100644
--- a/pages/report/received.tsx
+++ b/pages/report/received.tsx
@@ -2,14 +2,18 @@ import Meta from "../../components/meta";
export default function ReceivedPage() {
return (
-
+
}
url="https://soapbox.social/report/received"
/>
- Thank you, we've received your report.
+
+
+
Received. Thank you
+
+
);
}
diff --git a/pages/room/[id].tsx b/pages/room/[id].tsx
index 539b80f..32a7340 100644
--- a/pages/room/[id].tsx
+++ b/pages/room/[id].tsx
@@ -4,13 +4,13 @@ import Meta from "../../components/meta";
import RoomPreview from "../../components/room-preview";
import { APP_ID, APP_NAME } from "../../constants";
-export default function RoomPage({
- room,
-}: InferGetServerSidePropsType) {
+type Props = InferGetServerSidePropsType;
+
+export default function RoomPage({ room }: Props) {
const APP_LINK = `soapbox://room/${room.id}`;
return (
-
+
-
+
+
+
);
}
diff --git a/pages/support.tsx b/pages/support.tsx
index d1a0a28..8c944d1 100644
--- a/pages/support.tsx
+++ b/pages/support.tsx
@@ -3,16 +3,25 @@ import { CONTACT_URL } from "../constants";
export default function SupportPage() {
return (
-
+
- Support
+
);
}
diff --git a/pages/terms.tsx b/pages/terms.tsx
index 185f61d..94cff83 100644
--- a/pages/terms.tsx
+++ b/pages/terms.tsx
@@ -3,11 +3,13 @@ import EndUserLicenseAgreement from "../legal/eula.mdx";
export default function TermsPage() {
return (
-
+
-
-
+
);
diff --git a/pages/user/[username].tsx b/pages/user/[username].tsx
index 4f48037..df96c93 100644
--- a/pages/user/[username].tsx
+++ b/pages/user/[username].tsx
@@ -4,15 +4,15 @@ import { Fragment } from "react";
import Meta from "../../components/meta";
import { APP_ID, APP_NAME } from "../../constants";
-export default function UserPage({
- profile,
-}: InferGetServerSidePropsType
) {
+type Props = InferGetServerSidePropsType;
+
+export default function UserPage({ profile }: Props) {
const APP_LINK = `soapbox://user/${profile.username}`;
const IMAGE = `https://cdn.soapbox.social/images/${profile.image}`;
return (
-
+