Skip to content

Commit 3aa492c

Browse files
committed
fix: typescript 구문 에러 해결
1 parent a0d39fc commit 3aa492c

7 files changed

Lines changed: 41 additions & 11 deletions

File tree

src/app/(auth)/social-callback/page.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { useEffect, useState } from "react";
3+
import { useEffect, useState, Suspense } from "react";
44
import { useSearchParams, useRouter } from "next/navigation";
55
import { Loader2 } from "lucide-react";
66
import SocialSignUpForm from "@/components/auth/SocialSignUpForm";
@@ -13,7 +13,7 @@ import {
1313
} from "@/lib/auth/socialAuth";
1414
import { useAuth } from "@/contexts/AuthContext";
1515

16-
export default function SocialCallbackPage() {
16+
function SocialCallbackContent() {
1717
const searchParams = useSearchParams();
1818
const router = useRouter();
1919
const { refreshUser } = useAuth();
@@ -179,3 +179,20 @@ export default function SocialCallbackPage() {
179179

180180
return null;
181181
}
182+
183+
export default function SocialCallbackPage() {
184+
return (
185+
<Suspense
186+
fallback={
187+
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 via-white to-purple-50">
188+
<div className="text-center">
189+
<Loader2 className="w-12 h-12 animate-spin text-blue-600 mx-auto mb-4" />
190+
<p className="text-gray-600">로딩 중...</p>
191+
</div>
192+
</div>
193+
}
194+
>
195+
<SocialCallbackContent />
196+
</Suspense>
197+
);
198+
}

src/app/(main)/community/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function CommunityPage() {
4545
</div>
4646

4747
{/* Post List */}
48-
<PostList boardId={selectedBoardId} sort={sortOption} />
48+
<PostList boardId={selectedBoardId} />
4949

5050
{/* Post Create Modal */}
5151
<PostCreateModal

src/app/(main)/mypage/page.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,20 @@ import { useAuth } from "@/contexts/AuthContext";
1818
import LoginModal from "@/components/auth/LoginModal";
1919

2020
// TODO: 실제 API 연동 시 교체
21-
const mockUserData = {
21+
interface ExtendedUser {
22+
userId?: number;
23+
id?: number;
24+
email: string;
25+
nickname: string;
26+
profileImageUrl: string | null;
27+
status?: string;
28+
role?: string;
29+
createdAt?: string;
30+
updatedAt?: string;
31+
lastLoginAt?: string;
32+
}
33+
34+
const mockUserData: ExtendedUser = {
2235
id: 1,
2336
email: "user@example.com",
2437
nickname: "데브노기유저",
@@ -36,7 +49,7 @@ export default function MyPage() {
3649
const [isLoginModalOpen, setIsLoginModalOpen] = useState(false);
3750

3851
// authUser가 있으면 authUser 사용, 없으면 mockData 사용 (개발 편의상)
39-
const user = authUser || mockUserData;
52+
const user: ExtendedUser = authUser || mockUserData;
4053

4154
useEffect(() => {
4255
// 로딩이 끝나고 인증되지 않은 경우 로그인 모달 표시
@@ -153,7 +166,7 @@ export default function MyPage() {
153166
<h1 className="text-2xl font-bold text-gray-900">
154167
{authUser?.nickname || user.nickname}
155168
</h1>
156-
{getStatusBadge(user.status)}
169+
{getStatusBadge(user.status || "ACTIVE")}
157170
</div>
158171
<p className="text-gray-600 flex items-center gap-2 mb-4">
159172
<Mail className="w-4 h-4" />
@@ -192,7 +205,7 @@ export default function MyPage() {
192205
<InfoRow
193206
icon={<Shield className="w-5 h-5 text-gray-400" />}
194207
label="권한"
195-
value={user.role === "USER" ? "일반 회원" : "관리자"}
208+
value={(user.role || "USER") === "USER" ? "일반 회원" : "관리자"}
196209
/>
197210
{user.createdAt && (
198211
<InfoRow

src/app/api/auth/check-email/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function GET(request: NextRequest) {
3434
console.error("에러 상태:", axiosError.response.status);
3535
console.error("에러 데이터:", axiosError.response.data);
3636
console.error("에러 헤더:", axiosError.response.headers);
37-
console.error("요청 URL:", axiosError.config?.baseURL + axiosError.config?.url);
37+
console.error("요청 URL:", (axiosError.config?.baseURL || "") + (axiosError.config?.url || ""));
3838

3939
return NextResponse.json(
4040
{

src/components/auth/LoginModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const loginSchema = z.object({
3636
.string()
3737
.min(6, { message: "비밀번호는 6자 이상 입력해주세요" })
3838
.max(50, { message: "비밀번호는 50자 이하로 입력해주세요" }),
39-
rememberMe: z.boolean().default(false),
39+
rememberMe: z.boolean(),
4040
});
4141

4242
type LoginFormData = z.infer<typeof loginSchema>;

src/components/commons/Category.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function ItemCategorySection({
9292
categories: ItemCategory[];
9393
}) {
9494
const [isScrolling, setIsScrolling] = useState(false);
95-
const scrollTimeoutRef = useRef<NodeJS.Timeout>();
95+
const scrollTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined);
9696
const containerRef = useRef<HTMLDivElement>(null);
9797

9898
const handleScroll = () => {

src/components/commons/CategoryModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default function CategoryModal({
100100
categories,
101101
}: CategoryModalProps) {
102102
const [isScrolling, setIsScrolling] = useState(false);
103-
const scrollTimeoutRef = useRef<NodeJS.Timeout>();
103+
const scrollTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined);
104104
const containerRef = useRef<HTMLDivElement>(null);
105105

106106
const handleScroll = () => {

0 commit comments

Comments
 (0)