diff --git a/app/src/app/camera/page.tsx b/app/src/app/camera/page.tsx index 0005bb7..db6935e 100644 --- a/app/src/app/camera/page.tsx +++ b/app/src/app/camera/page.tsx @@ -20,7 +20,7 @@ import { PointDialog } from "@/components/view/PointDialog"; import { shapeCaption } from "@/functions/shapeCaption"; import { postSimilarity } from "@/functions/simirality"; import { usePointDialogOpen } from "@/lib/atom"; -import type { ScoreResponse, User, todayAssignment } from "@/types"; +import type { ScoreResponse, DBUser as User, todayAssignment } from "@/types"; import imageCompression from "browser-image-compression"; import type React from "react"; import { useEffect, useRef, useState } from "react"; @@ -107,7 +107,7 @@ const CameraApp = () => { console.error("ユーザー情報が取得できませんでした。"); return; } - const userInfo = JSON.parse(user); + const userInfo: User = JSON.parse(user); setLoginUser(userInfo); const resAssignment = await fetch( `/api/assignment/today?uid=${userInfo?.uid}`, diff --git a/app/src/app/page.tsx b/app/src/app/page.tsx index 1c89589..b2697e1 100755 --- a/app/src/app/page.tsx +++ b/app/src/app/page.tsx @@ -6,7 +6,12 @@ import { Progress } from "@/components/ui/progress"; import { PointDialog } from "@/components/view/PointDialog"; import Timer from "@/components/view/Timer"; import { useHasShownOnce, usePointDialogOpen } from "@/lib/atom"; -import type { MyScoreDetail, Score, todayAssignment } from "@/types"; +import type { + MyScoreDetail, + Score, + DBUser as User, + todayAssignment, +} from "@/types"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; @@ -37,7 +42,7 @@ export default function Home() { try { // get api/score/me - const userData = JSON.parse(userIdString); + const userData: User = JSON.parse(userIdString); const uid = userData.uid; if (!uid) { throw new Error("User ID not found"); @@ -111,7 +116,9 @@ export default function Home() { const latestAssignment = assignment .filter((item) => item.assignTime) - .sort((a, b) => (b.assignTime?.getTime() ?? 0) - (a.assignTime?.getTime() ?? 0))[0]; + .sort( + (a, b) => (b.assignTime?.getTime() ?? 0) - (a.assignTime?.getTime() ?? 0), + )[0]; return (
diff --git a/app/src/app/user/page.tsx b/app/src/app/user/page.tsx index 1f4fa75..f659fdf 100644 --- a/app/src/app/user/page.tsx +++ b/app/src/app/user/page.tsx @@ -7,7 +7,7 @@ import PlayerRankCard from "@/components/view/user/PlayerRankCard"; import StatusChangeDialog from "@/components/view/user/StatusChangeDialog"; import StatusList from "@/components/view/user/StatusList"; import { useStatusChangeDialog } from "@/lib/atom"; -import type { MyScoreDetail, User } from "@/types"; +import type { MyScoreDetail, DBUser as User } from "@/types"; import { useEffect, useState } from "react"; import { FiEdit2 } from "react-icons/fi"; import { LuClock, LuFlame, LuTrophy } from "react-icons/lu"; @@ -50,9 +50,9 @@ const UserPage = () => { return (
- {userData.photoURL ? ( + {userData.photoUrl ? ( User Icon @@ -80,7 +80,7 @@ const UserPage = () => { ) : ( <> - {userData.displayName || "user@example.com"} + {userData.name || "user@example.com"}