Skip to content

Commit d7e8271

Browse files
manNomi한만욱
andauthored
Refactor/component (#203)
* feat : serverFetch 구현했습니다 * fix: 컴포넌트 비삭제 된 요소 삭제했습니다 * refactor : MyMentoSection 분리했습니다 * refactor : MyMentorSection 으로 수정했습니다 * refactor : Mentor 로 통일 및 폴더구조 개선했습니다 * refactor : 컴포넌트 영역의 하드코딩된 값 모두 테일윈드 값으로 수정했습니다 * refactor: body 단일화·any 제거·HttpError 추가 했습니다 * refactor : decode 함수 분리했습니다 * fix : 일관성 위해 Buffer -> atob로 수정했습니다 * refactor : MentorCard 분리했습니다 * refactor : MentorCard 분리했습니다 * refactor : component -> ui 로 수정했습니다 * refactor : Article Card 분리했습니다: * refactor : ChannelSelect 숨겨진 input 삭제했습니다 * refactor : MentorApply 삭제 및 clsx 추가했습니다 * feat : 멘토 api 폴더 구조 정립했습니다 * feat : MentorFindSection 무한스크롤 구현했습니다 * feat : useGetMyMentorProfile 구현했습니다 * feat : 특정 멘토 페이지 구현했습니다 * feat : useGetArticle 연결했습니다 * feat : ArticlePanel useDeleteArticle 연결했습니다 * feat : MentoModify 구현했습니다 * fix : 멘토 챗 카드 디자인수정했습니다 * feat : MentorApplyCountModal 구현했습니다 " * feat : RootModal 및 신규 신청 알림 구현했습니다 * fix : 디자인 및 RootModal 구조 수정했습니다 * feat : RootModal의 클라이언트 , 서버 모달 나눴습니다 * feat : zustnad로 커스텀 confirm 함수 구현했습니다 * fix : IconConfirmModal 수정 두개 메시지 받도록 수정및 customConfirm 으로 수정했습니다 * fix : ClientModal에 useclient 추가했습니다 * refactor : PR 코멘트 내용이었던 set함수와 controller 의 증복을 제거했습니다 * refactor : PR 코멘트 반영했습니다 Link 임포트가 잘못된 부분 제거했습니다 * refactor : 불필요 컴포넌트 삭제 했습니다 * refactor : PR 코멘트 반영했습니다 likeicon 오타 수정했습니다 * fix : serverFetch 글로벌 세마포어를 key로 관리하도록 수정했습니다 * fix : GlobalLayout 구현 및 useLayout 요소 모두 제거했습니다 * refactor : TopLogoBar 로 리팩토링했습니다 * chore : sentry.client 수정했습니다 * fix : useGetArticleList 오타 수정 및 Tab 요소 위치 버그 수정했습니다 * fix : PR 내용 반영했습니다 * fix : build 버그 보완했습니다 * refactor : 이동 요소 추가했습니다 * fix :community 오타 수정했습니다 * fix : conflict 버전 충돌문제 해결했습니다 --------- Co-authored-by: 한만욱 <manwook-han@hanman-ug-ui-MacBookPro.local>
1 parent 4b6aff0 commit d7e8271

68 files changed

Lines changed: 623 additions & 371 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sentry.client.config.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
1-
// This file configures the initialization of Sentry on the client.
2-
// The config you add here will be used whenever a users loads a page in their browser.
3-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
41
import * as Sentry from "@sentry/nextjs";
52

63
Sentry.init({
74
dsn: process.env.SENTRY_DSN || "",
85
environment: process.env.SENTRY_ENVIRONMENT || "development",
6+
tracesSampleRate: 1.0,
97

10-
// Adjust this value in production, or use tracesSampler for greater control
11-
tracesSampleRate: 1,
12-
13-
// Setting this option to true will print useful information to the console while you're setting up Sentry.
14-
debug: false,
15-
16-
replaysOnErrorSampleRate: 1.0,
17-
18-
// This sets the sample rate to be 10%. You may want this to be 100% while
19-
// in development and sample at a lower rate in production
20-
replaysSessionSampleRate: 0.1,
21-
22-
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
238
integrations: [
9+
Sentry.browserTracingIntegration({
10+
tracePropagationTargets: ["localhost", /^https:\/\/(www\.)?solid\-connection\.com/],
11+
}),
2412
Sentry.replayIntegration({
25-
// Additional Replay configuration goes in here, for example:
2613
maskAllText: true,
2714
blockAllMedia: true,
2815
}),
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { useEffect, useState } from "react";
2+
3+
import useFetch from "@/utils/apiUtils";
4+
5+
import { ArticleResponse } from "../type/response";
6+
7+
/* ---------- 타입 ---------- */
8+
9+
interface ArticleListResponse {
10+
news: ArticleResponse[]; // 최대 5개
11+
}
12+
13+
const useGetArticleList = (userId: number | null) => {
14+
const { result, loading, error, fetchData } = useFetch<ArticleListResponse>();
15+
16+
const [articleList, setArticleList] = useState<ArticleResponse[]>([]);
17+
18+
/* 페이지 변경 시 데이터 요청 */
19+
useEffect(() => {
20+
if (userId === null) return;
21+
22+
fetchData({
23+
method: "get",
24+
url: `/news?site-user-id=${userId}`,
25+
body: undefined,
26+
isToken: true,
27+
});
28+
}, [userId, fetchData]);
29+
30+
/* 응답 처리 */
31+
useEffect(() => {
32+
if (result) {
33+
setArticleList(result.data.news);
34+
}
35+
}, [result]);
36+
37+
return { articleList, loading, error };
38+
};
39+
40+
export default useGetArticleList;

src/api/mentor/client/useGetMyMentorProfile.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ interface UseGetMyMentorDataReturn {
1212

1313
const useGetMyMentorProfile = (): UseGetMyMentorDataReturn => {
1414
const { result, loading, error, fetchData } = useFetch<MentorCardPreview>();
15+
<<<<<<< HEAD
16+
const [myMentorProfile, setMyMentorProfile] = useState<MentorCardPreview>(null);
17+
=======
1518
const [myMentorProfile, setMyMentorProfile] = useState<MentorCardPreview>({} as MentorCardPreview);
19+
>>>>>>> main
1620

1721
useEffect(() => {
1822
fetchData({

src/api/mentor/type/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface MentorCardBase {
3030
}
3131

3232
/** 리스트(미리보기) 용 – passTip / isApplied 없이 사용 */
33-
export type MentorCardPreview = MentorCardBase & { studyStatus: "24-1" | "24-2" }; // 학업 상태 (예: "24-1")
33+
export type MentorCardPreview = (MentorCardBase & { studyStatus: "24-1" | "24-2" }) | null; // 학업 상태 (예: "24-1")
3434

3535
/** 상세 뷰 용 – 추가 정보 포함 */
3636
export interface MentorCardDetail extends MentorCardBase {

src/app/application/ScorePageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import { useRouter } from "next/navigation";
44
import { useEffect, useRef, useState } from "react";
55

6-
import CloudSpinnerPage from "@/components/loading/CloudSpinnerPage";
76
import ConfirmCancelModal from "@/components/modal/ConfirmCancelModal";
87
import ButtonTab from "@/components/ui/ButtonTab";
8+
import CloudSpinnerPage from "@/components/ui/CloudSpinnerPage";
99
import Tab from "@/components/ui/Tab";
1010

1111
import ScoreSearchBar from "./ScoreSearchBar";

src/app/community/[boardCode]/CommunityPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { useRouter } from "next/navigation";
44
import { useEffect, useState } from "react";
55

6-
import CloudSpinnerPage from "@/components/loading/CloudSpinnerPage";
76
import ButtonTab from "@/components/ui/ButtonTab";
7+
import CloudSpinnerPage from "@/components/ui/CloudSpinnerPage";
88

99
import CommunityRegionSelector from "./CommunityRegionSelector";
1010
import PostCards from "./PostCards";

src/app/community/[boardCode]/[postId]/PostPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useRouter } from "next/navigation";
44
import { useEffect, useState } from "react";
55

66
import TopDetailNavigation from "@/components/layout/TopDetailNavigation";
7-
import CloudSpinnerPage from "@/components/loading/CloudSpinnerPage";
7+
import CloudSpinnerPage from "@/components/ui/CloudSpinnerPage";
88

99
import CommentSection from "./CommentSection";
1010
import Content from "./Content";

src/app/community/[boardCode]/[postId]/modify/PostModifyContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useRouter } from "next/navigation";
44
import { useEffect, useState } from "react";
55

6-
import CloudSpinnerPage from "@/components/loading/CloudSpinnerPage";
6+
import CloudSpinnerPage from "@/components/ui/CloudSpinnerPage";
77

88
import PostModifyForm from "./PostModifyForm";
99

src/app/layout.tsx

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import type { Metadata, Viewport } from "next";
22
import { Inter } from "next/font/google";
33
import localFont from "next/font/local";
44

5-
import AppleScriptLoader from "@/components/layout/AppleScriptLoader";
6-
import KakaoScriptLoader from "@/components/layout/KakaoScriptLoader";
7-
import Layout from "@/components/layout/Layout";
8-
import RootModal from "@/components/layout/RootModal";
5+
import GlobalLayout from "@/components/layout/GlobalLayout";
96

107
import "../styles/globals.css";
118

129
import { AlertProvider } from "@/context/AlertContext";
13-
import { LayoutProvider } from "@/context/LayoutContext";
10+
import AppleScriptLoader from "@/lib/ScriptLoader/AppleScriptLoader";
11+
import KakaoScriptLoader from "@/lib/ScriptLoader/KakaoScriptLoader";
1412
import { GoogleAnalytics } from "@next/third-parties/google";
1513

1614
export const metadata: Metadata = {
@@ -46,17 +44,14 @@ export const viewport: Viewport = {
4644

4745
const RootLayout = ({ children }: { children: React.ReactNode }) => (
4846
<AlertProvider>
49-
<LayoutProvider>
50-
<html lang="ko" className="font-serif">
51-
<KakaoScriptLoader />
52-
<AppleScriptLoader />
53-
<GoogleAnalytics gaId="G-V1KLYZC1DS" />
54-
<body className={`${pretendard.className} ${inter.className}`}>
55-
<Layout>{children}</Layout>
56-
<RootModal />
57-
</body>
58-
</html>
59-
</LayoutProvider>
47+
<html lang="ko" className="font-serif">
48+
<KakaoScriptLoader />
49+
<AppleScriptLoader />
50+
<GoogleAnalytics gaId="G-V1KLYZC1DS" />
51+
<body className={`${pretendard.className} ${inter.className}`}>
52+
<GlobalLayout>{children}</GlobalLayout>
53+
</body>
54+
</html>
6055
</AlertProvider>
6156
);
6257

src/app/login/LoginContent.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,14 @@ import KakaoLoginButton from "./KakaoLoginButton";
1515
import { appleOAuth2CodeResponse } from "@/types/auth";
1616

1717
import { emailAuthApi } from "@/api/auth";
18-
import { useLayout } from "@/context/LayoutContext";
1918
import { IconSolidConnectionFullBlackLogo } from "@/public/svgs";
2019

2120
const LoginContent = () => {
2221
const router = useRouter();
23-
const { setHideBottomNavigation } = useLayout();
2422

2523
const [email, setEmail] = useState("");
2624
const [password, setPassword] = useState("");
2725

28-
useEffect(() => {
29-
setHideBottomNavigation(true);
30-
return () => setHideBottomNavigation(false);
31-
}, [setHideBottomNavigation]);
32-
3326
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
3427
if (e.key === "Enter") {
3528
handleEmailLogin();

0 commit comments

Comments
 (0)