mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: build errors
This commit is contained in:
parent
1d11cf3f99
commit
8ef2b18424
11 changed files with 28 additions and 64 deletions
|
|
@ -2,9 +2,6 @@ import type { NextConfig } from "next";
|
|||
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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<Metadata> {
|
||||
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 <EditForm mii={mii} likes={mii._count.likedBy} />;
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
import ReasonSelector from "./reason-selector";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { Icon } from "@iconify/react";
|
||||
import { ReportReason } from "@prisma/client";
|
||||
import { useSelect } from "downshift";
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
<hr className="border-zinc-300" />
|
||||
|
||||
<div className="bg-orange-100 rounded-xl border-2 border-orange-400 flex p-4 gap-4">
|
||||
<image src={user.image ?? "/guest.png"} width={96} height={96} className="aspect-square rounded-full border-2 border-orange-400" />
|
||||
<Image
|
||||
src={user.image ?? "/guest.png"}
|
||||
alt="profile picture"
|
||||
width={96}
|
||||
height={96}
|
||||
className="aspect-square rounded-full border-2 border-orange-400"
|
||||
/>
|
||||
<p className="text-xl font-bold overflow-hidden text-ellipsis">{user.name}</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>TomodachiShare</title>
|
||||
<meta name="description" content="Discover and share Mii residents for your Tomodachi Life island!" />
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue