diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index d92ce0c..88db816 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,5 +1,7 @@ # TomodachiShare Development Instructions +This is probably outdated. + Welcome to the TomodachiShare development guide! This project uses [pnpm](https://pnpm.io/) for package management, [Next.js](https://nextjs.org/) with the app router for the front-end and back-end, [Prisma](https://prisma.io) for the database, [TailwindCSS](https://tailwindcss.com/) for styling, and [TypeScript](https://www.typescriptlang.org/) for type safety. ## Getting started diff --git a/README.md b/README.md index 37072a8..9282cb9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- TomodachiShare Logo + TomodachiShare Logo

TomodachiShare

diff --git a/backend/src/app/report/mii/[id]/page.tsx b/backend/src/app/report/mii/[id]/page.tsx deleted file mode 100644 index da40d1a..0000000 --- a/backend/src/app/report/mii/[id]/page.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { Metadata } from "next"; -import { redirect } from "next/navigation"; - -import { auth } from "@/lib/auth"; -import { prisma } from "@/lib/prisma"; - -import ReportMiiForm from "@/components/report/mii-form"; - -interface Props { - params: Promise<{ id: string }>; -} - -export const metadata: Metadata = { - title: "Report Mii - TomodachiShare", - description: "Report a Mii on TomodachiShare", - robots: { - index: false, - follow: false, - }, -}; - -export default async function ReportMiiPage({ params }: Props) { - const session = await auth(); - const { id } = await params; - - const mii = await prisma.mii.findUnique({ - where: { - id: Number(id), - }, - include: { - _count: { - select: { - likedBy: true, - }, - }, - }, - }); - - if (!session) redirect("/login"); - if (!mii) redirect("/404"); - - return ( -
- -
- ); -} diff --git a/backend/src/app/report/user/[id]/page.tsx b/backend/src/app/report/user/[id]/page.tsx deleted file mode 100644 index fae91bc..0000000 --- a/backend/src/app/report/user/[id]/page.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Metadata } from "next"; -import { redirect } from "next/navigation"; - -import { auth } from "@/lib/auth"; -import { prisma } from "@/lib/prisma"; - -import ReportUserForm from "@/components/report/user-form"; - -interface Props { - params: Promise<{ id: string }>; -} - -export const metadata: Metadata = { - title: "Report User - TomodachiShare", - description: "Report a user on TomodachiShare", - robots: { - index: false, - follow: false, - }, -}; - -export default async function ReportUserPage({ params }: Props) { - const session = await auth(); - const { id } = await params; - - const user = await prisma.user.findUnique({ - where: { - id: Number(id), - }, - }); - - if (!session) redirect("/login"); - if (!user) redirect("/404"); - - return ( -
- -
- ); -} diff --git a/backend/src/components/report/mii-form.tsx b/backend/src/components/report/mii-form.tsx deleted file mode 100644 index fb65fdf..0000000 --- a/backend/src/components/report/mii-form.tsx +++ /dev/null @@ -1,81 +0,0 @@ -"use client"; - -import { useState } from "react"; - -import ReasonSelector from "./reason-selector"; -import SubmitButton from "../submit-button"; -import { Mii, ReportReason } from "@prisma/client"; - -interface Props { - mii: Mii; - likes: number; -} - -export default function ReportMiiForm({ mii, likes }: Props) { - const [reason, setReason] = useState(); - const [notes, setNotes] = useState(); - const [error, setError] = useState(undefined); - - const handleSubmit = async () => { - const response = await fetch(`/api/report`, { - method: "POST", - body: JSON.stringify({ id: mii.id, type: "mii", reason: reason?.toLowerCase(), notes }), - }); - const { error } = await response.json(); - - if (!response.ok) { - setError(error); - return; - } - - // redirect(`/`); - window.location.href = "https://tomodachishare.com"; - }; - - return ( -
-
-

Report a Mii

-

If you encounter a rule-breaking Mii, please report it here

-
- -
- -
- mii image -
-

{mii.name}

- {/* */} -
-
- -
- - -
- -
- -