Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/web/.next/app-build-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/not-found.js"
],
"/my/page": [
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/my/page.js"
],
"/_not-found/page": [
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/_not-found/page.js"
],
"/login/page": [
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/login/page.js"
]
}
}
Binary file modified apps/web/.next/cache/webpack/client-development/0.pack.gz
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion apps/web/.next/server/app-paths-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"/(home)/page": "app/(home)/page.js"
"/my/page": "app/my/page.js",
"/login/page": "app/login/page.js"
}

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/web/.next/server/next-font-manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/web/.next/server/next-font-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"pages":{},"app":{"/Users/manwook-han/Desktop/code/solid-connect/solid-connect-2/apps/web/src/app/layout":["static/media/ff840cfebfb63b0c-s.p.woff2"]},"appUsingSizeAdjust":true,"pagesUsingSizeAdjust":false}
{"pages":{},"app":{"/Users/manwook-han/Desktop/code/solid-connect/solid-connect-web/apps/web/src/app/layout":["static/media/ff840cfebfb63b0c-s.p.woff2"]},"appUsingSizeAdjust":true,"pagesUsingSizeAdjust":false}
2 changes: 1 addition & 1 deletion apps/web/.next/server/server-reference-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"node": {},
"edge": {},
"encryptionKey": "M+bS2fB6AURvBRePAXX1HE5tEwaLoXu/jV6C2NVrICg="
"encryptionKey": "HZHEW8edaFOoOyNTJQH9263qZ1mOC136vc6j1SZK4QU="
}
2 changes: 1 addition & 1 deletion apps/web/.next/server/webpack-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("655473fd8895fc20")
/******/ __webpack_require__.h = () => ("31942895fc817e26")
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
Expand Down
330 changes: 165 additions & 165 deletions apps/web/.next/static/chunks/app/layout.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/web/.next/static/chunks/styles.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/web/.next/static/chunks/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "d0c0d43c0cea9bf8"; }
/******/ __webpack_require__.h = function() { return "370d9ef8110b40fd"; }
/******/ }();
/******/
/******/ /* webpack/runtime/global */
Expand Down
28 changes: 17 additions & 11 deletions apps/web/.next/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,9 @@ video {
.cursor-pointer {
cursor: pointer;
}
.cursor-wait {
cursor: wait;
}
.select-none {
-webkit-user-select: none;
-moz-user-select: none;
Expand Down Expand Up @@ -1682,24 +1685,24 @@ video {
border-radius: 9999px;
}
.rounded-lg {
border-radius: var(--radius);
border-radius: 0.5rem;
}
.rounded-md {
border-radius: calc(var(--radius) - 2px);
border-radius: 0.375rem;
}
.rounded-sm {
border-radius: calc(var(--radius) - 4px);
border-radius: 0.25rem;
}
.rounded-xl {
border-radius: 0.75rem;
}
.rounded-b-lg {
border-bottom-right-radius: var(--radius);
border-bottom-left-radius: var(--radius);
border-bottom-right-radius: 0.5rem;
border-bottom-left-radius: 0.5rem;
}
.rounded-b-md {
border-bottom-right-radius: calc(var(--radius) - 2px);
border-bottom-left-radius: calc(var(--radius) - 2px);
border-bottom-right-radius: 0.375rem;
border-bottom-left-radius: 0.375rem;
}
.rounded-b-xl {
border-bottom-right-radius: 0.75rem;
Expand All @@ -1718,12 +1721,12 @@ video {
border-top-right-radius: 1.5rem;
}
.rounded-t-lg {
border-top-left-radius: var(--radius);
border-top-right-radius: var(--radius);
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}
.rounded-t-md {
border-top-left-radius: calc(var(--radius) - 2px);
border-top-right-radius: calc(var(--radius) - 2px);
border-top-left-radius: 0.375rem;
border-top-right-radius: 0.375rem;
}
.rounded-bl-2xl {
border-bottom-left-radius: 1rem;
Expand Down Expand Up @@ -1967,6 +1970,9 @@ video {
--tw-bg-opacity: 1;
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
}
.bg-black\/30 {
background-color: rgb(0 0 0 / 0.3);
}
.bg-blue-100 {
--tw-bg-opacity: 1;
background-color: rgb(219 234 254 / var(--tw-bg-opacity, 1));
Expand Down
2 changes: 1 addition & 1 deletion apps/web/.next/types/app/layout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File: /Users/manwook-han/Desktop/code/solid-connect/solid-connect-2/apps/web/src/app/layout.tsx
// File: /Users/manwook-han/Desktop/code/solid-connect/solid-connect-web/apps/web/src/app/layout.tsx
import * as entry from '../../../src/app/layout.js'
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'

Expand Down
4 changes: 2 additions & 2 deletions apps/web/biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.12/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down Expand Up @@ -65,7 +65,7 @@
"noMisleadingInstantiator": "error",
"noNonNullAssertedOptionalChain": "error",
"noRedeclare": "warn",
"noUnknownAtRules": "warn",
"noUnknownAtRules": "off",
"noUnsafeDeclarationMerging": "error",
"useIterableCallbackReturn": "warn",
"useNamespaceKeyword": "error",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use client";

import MenteePageTabs from "../MenteePageTabs";
import MentorFindSection from "../MentorFindSection";

/**
* 멘티 페이지 컴포넌트
* - 나의 멘토 탭 (진행 중, 대기 중)
* - 멘토 찾기 섹션
*/
const MenteePage = () => {
return (
<>
{/* 탭 및 나의 멘토, 멘티요청 리스트 채팅카드 */}
<MenteePageTabs />
{/* 멘토찾기 섹션 */}
<MentorFindSection />
</>
);
};

export default MenteePage;
78 changes: 56 additions & 22 deletions apps/web/src/app/mentor/_ui/MentorClient/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,70 @@
"use client";

import { useState } from "react";
import { useRouter } from "next/navigation";
import { lazy, Suspense, useEffect, useState } from "react";
import { postReissueToken } from "@/apis/Auth";
import CloudSpinnerPage from "@/components/ui/CloudSpinnerPage";
import useAuthStore from "@/lib/zustand/useAuthStore";
import { UserRole } from "@/types/mentor";
import { tokenParse } from "@/utils/jwtUtils";
import MenteePageTabs from "./_ui/MenteePageTabs";
import MentorFindSection from "./_ui/MentorFindSection";
import MentorPage from "./_ui/MentorPage";

// 레이지 로드 컴포넌트
const MenteePage = lazy(() => import("./_ui/MenteePage"));
const MentorPage = lazy(() => import("./_ui/MentorPage"));

const MentorClient = () => {
const { isLoading, accessToken } = useAuthStore();
const parsedToken = tokenParse(accessToken);
const userRole = parsedToken?.role;
const isMentor = userRole === UserRole.MENTOR || userRole === UserRole.ADMIN;
const isAdmin = userRole === UserRole.ADMIN;
const router = useRouter();
const { isLoading, accessToken, isInitialized, refreshStatus, setRefreshStatus } = useAuthStore();
const [isRefreshing, setIsRefreshing] = useState(false);

// 어드민 전용: 뷰 전환 상태 (true: 멘토 뷰, false: 멘티 뷰)
const [showMentorView, setShowMentorView] = useState<boolean>(true);

if (isLoading || !accessToken) return <CloudSpinnerPage />; // 로딩 중일 때 스피너 표시
// 토큰 재발급 로직
useEffect(() => {
const attemptTokenRefresh = async () => {
// 이미 실패한 경우 재시도하지 않음 (무한 루프 방지)
if (refreshStatus === "failed") {
return;
}

// 이미 초기화되었고 토큰이 없는 경우에만 재발급 시도
if (!isInitialized || accessToken || isRefreshing || refreshStatus === "refreshing") {
return;
}

setIsRefreshing(true);
setRefreshStatus("refreshing");

try {
await postReissueToken();
setRefreshStatus("success");
} catch {
// 재발급 실패 시 로그인 페이지로 리다이렉트
setRefreshStatus("failed");
router.push("/login?redirect=/mentor");
} finally {
setIsRefreshing(false);
}
};

attemptTokenRefresh();
}, [isInitialized, accessToken, isRefreshing, refreshStatus, setRefreshStatus, router]);

// 초기화 전이거나 로딩 중이거나 재발급 중일 때 스피너 표시
if (!isInitialized || isLoading || refreshStatus === "refreshing" || isRefreshing) {
return <CloudSpinnerPage />;
}

// 초기화 완료 후에도 토큰이 없으면 리다이렉트 (useEffect에서 처리되지만 fallback)
if (!accessToken) {
return <CloudSpinnerPage />;
}

const parsedToken = tokenParse(accessToken);
const userRole = parsedToken?.role;
const isMentor = userRole === UserRole.MENTOR || userRole === UserRole.ADMIN;
const isAdmin = userRole === UserRole.ADMIN;

// 어드민이 아닌 경우 기존 로직대로
const shouldShowMentorView = isAdmin ? showMentorView : isMentor;
Expand Down Expand Up @@ -48,18 +93,7 @@ const MentorClient = () => {
</div>
)}

{shouldShowMentorView ? (
// 멘토페이지
<MentorPage />
) : (
// 멘티페이지
<>
{/* 탭 및 나의 멘토 , 멘티요청 리스트 채팅카드 */}
<MenteePageTabs />
{/* 멘토찾기 섹션 */}
<MentorFindSection />
</>
)}
<Suspense fallback={<CloudSpinnerPage />}>{shouldShowMentorView ? <MentorPage /> : <MenteePage />}</Suspense>
</>
);
};
Expand Down
Loading