diff --git a/backend/next.config.ts b/backend/next.config.ts index 30f5829..9253312 100644 --- a/backend/next.config.ts +++ b/backend/next.config.ts @@ -2,9 +2,6 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", - images: { - unoptimized: true, - }, async headers() { return [ { diff --git a/backend/package.json b/backend/package.json index 1a7a83f..f08fd13 100644 --- a/backend/package.json +++ b/backend/package.json @@ -36,7 +36,9 @@ "sharp": "^0.34.5", "sjcl-with-all": "1.0.8", "swr": "^2.4.1", - "zod": "^4.3.6" + "zod": "^4.3.6", + "@tomodachi-share/shared": "workspace:*" + }, "devDependencies": { "@eslint/eslintrc": "^3.3.5", @@ -53,8 +55,7 @@ "prisma": "^6.19.2", "schema-dts": "^2.0.0", "tailwindcss": "^4.2.2", - "typescript": "^6.0.2", - "@tomodachi-share/shared": "workspace:*" + "typescript": "^6.0.2" }, "exports": { ".": "./src/types.d.ts" diff --git a/backend/src/app/edit/[id]/page.tsx b/backend/src/app/edit/[id]/page.tsx deleted file mode 100644 index 3008146..0000000 --- a/backend/src/app/edit/[id]/page.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Metadata } from "next"; -import { redirect } from "next/navigation"; - -import { auth } from "@/lib/auth"; -import { prisma } from "@/lib/prisma"; -import EditForm from "@/components/submit-form/edit-form"; - -interface Props { - params: Promise<{ id: string }>; -} - -export async function generateMetadata({ params }: Props): Promise { - const { id } = await params; - - const mii = await prisma.mii.findUnique({ - where: { - id: Number(id), - }, - }); - - return { - title: `${mii?.name} - TomodachiShare`, - description: `Edit the name, tags, and images of '${mii?.name}'`, - robots: { - index: false, - follow: false, - }, - }; -} - -export default async function MiiPage({ params }: Props) { - const { id } = await params; - const session = await auth(); - - const mii = await prisma.mii.findUnique({ - where: { - id: Number(id), - }, - include: { - _count: { - select: { likedBy: true }, // Get total like count - }, - }, - }); - - // Check ownership - if (!mii || (Number(session?.user?.id) !== mii.userId && Number(session?.user?.id) !== Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID))) redirect("/404"); - - return ; -} diff --git a/backend/src/components/report/mii-form.tsx b/backend/src/components/report/mii-form.tsx index e65dd06..fb65fdf 100644 --- a/backend/src/components/report/mii-form.tsx +++ b/backend/src/components/report/mii-form.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState } from "react"; import ReasonSelector from "./reason-selector"; diff --git a/backend/src/components/report/reason-selector.tsx b/backend/src/components/report/reason-selector.tsx index 1d46e07..c3513d1 100644 --- a/backend/src/components/report/reason-selector.tsx +++ b/backend/src/components/report/reason-selector.tsx @@ -1,3 +1,5 @@ +"use client"; + import { Icon } from "@iconify/react"; import { ReportReason } from "@prisma/client"; import { useSelect } from "downshift"; diff --git a/backend/src/components/report/user-form.tsx b/backend/src/components/report/user-form.tsx index 18cfcc6..b7851ce 100644 --- a/backend/src/components/report/user-form.tsx +++ b/backend/src/components/report/user-form.tsx @@ -1,9 +1,11 @@ +"use client"; + import { useState } from "react"; import ReasonSelector from "./reason-selector"; import SubmitButton from "../submit-button"; -import { ReportReason } from "@prisma/client"; -import { User } from "next-auth"; +import { ReportReason, User } from "@prisma/client"; +import Image from "next/image"; interface Props { user: User; @@ -39,7 +41,13 @@ export default function ReportUserForm({ user }: Props) {
- + profile picture

{user.name}

diff --git a/backend/src/components/submit-button.tsx b/backend/src/components/submit-button.tsx index 710985d..c5067a7 100644 --- a/backend/src/components/submit-button.tsx +++ b/backend/src/components/submit-button.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState } from "react"; import { Icon } from "@iconify/react"; diff --git a/frontend/index.html b/frontend/index.html index 6cede19..a4eaf3c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,7 +2,6 @@ - TomodachiShare diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 575f476..ee9035a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ importers: '@prisma/client': specifier: ^6.19.2 version: 6.19.3(prisma@6.19.3(typescript@6.0.2))(typescript@6.0.2) + '@tomodachi-share/shared': + specifier: workspace:* + version: link:../shared bit-buffer: specifier: ^0.3.0 version: 0.3.0 @@ -98,9 +101,6 @@ importers: '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 - '@tomodachi-share/shared': - specifier: workspace:* - version: link:../shared '@types/canvas-confetti': specifier: ^1.9.0 version: 1.9.0 diff --git a/shared/src/qr-codes.ts b/shared/src/qr-codes.ts index 3ea50ce..38dbb0c 100644 --- a/shared/src/qr-codes.ts +++ b/shared/src/qr-codes.ts @@ -19,7 +19,9 @@ import { ThreeDsTomodachiLifeMii, HairDyeMode } from "./three-ds-tomodachi-life- /** Private _ctrMode function defined here: {@link https://github.com/bitwiseshiftleft/sjcl/blob/85caa53c281eeeb502310013312c775d35fe0867/core/ccm.js#L194} */ const sjclCcmCtrMode: | ((prf: sjcl.SjclCipher, data: sjcl.BitArray, iv: sjcl.BitArray, tag: sjcl.BitArray, tlen: number, L: number) => { data: sjcl.BitArray; tag: sjcl.BitArray }) - | undefined = sjcl.mode.ccm.u; // NOTE: This may need to be changed with a different sjcl build. Read above + | undefined = + // @ts-ignore -- Referencing a private function that is not in the types. + sjcl.mode.ccm.u; // NOTE: This may need to be changed with a different sjcl build. Read above export function convertQrCode(bytes: Uint8Array): { mii: Mii; tomodachiLifeMii: ThreeDsTomodachiLifeMii } | never { // Decrypt 96 byte 3DS/Wii U format Mii data from the QR code. diff --git a/shared/src/three-ds-tomodachi-life-mii.ts b/shared/src/three-ds-tomodachi-life-mii.ts index 76a5972..ebfa21c 100644 --- a/shared/src/three-ds-tomodachi-life-mii.ts +++ b/shared/src/three-ds-tomodachi-life-mii.ts @@ -2,6 +2,7 @@ import { TOMODACHI_LIFE_DECRYPTION_KEY } from "./constants"; // @ts-ignore import sjcl from "sjcl-with-all"; +// @ts-ignore - This is not in the types, but it's a function needed to enable CTR mode. sjcl.beware["CTR mode is dangerous because it doesn't protect message integrity."](); // Converts hair dye to studio color