Skip to content

Commit ea0712d

Browse files
authored
Fix/3nd qa (#240)
* feat: 작품 둘러보기 - 스테이지/카테고리 쿼리파라미터로 이동하는 방식으로 변경 * feat: 작품 없을 시 문구 추가 및 리팩토링 * refectore: 작품 둘러보기 - 스테이지, 카테고리, 정렬 및 보기방식 포함한 PostHeaderControl컴포넌트 분리 * feat: 작품 둘러보기 - IntersectionObserver api 사용한 인피니트 스크롤 커스텀 * feat: react-intersection-observer 추가 * feat: 좋아한 작품 - 스테이지 변경 쿼리파라미터로 변경 * feat: 좋아한 작품 - 좋아한 작품이 없을 경우 페이지 구현 * feat: 작품 등록하지 - 완료 alert -> toastAlert로 변경 * feat: 작품 관리 상세 - 작품 수정 완료 alert -> toastAlert로 변경 * fix: 작품 관리 상세 - 무대 글자수 제한 30자로 변경 * fix: findUserId 응답 형식 수정 * fix: 아이디/비밀번호 찾기 버튼 이동 페이지 통합 * fix: 비밀번호 변경 후 재 로그인 했을 때 다시 비밀번호 찾기 페이지로 가는 문제 해결 * fix: 신청된 공연 - height: auto 로 변경 * fix: 작품관리 상세 - 공연권 5만원 초과 입력 시 설명 모달 + 빨간 보더 추가 * style: 작품 상세 - 좋아요와 뷰 위치 -> 작가명 하단에 맞추기 * fix: 작품 상세 - 하단 배너 옵션과 페이지 옵션 동기화 * fix: 작품 상세 - 미리보기 단편극일 경우 화살표 삭제 * fix: useWindowDimensions 훅의 해상도 조건 중첩 문제 수정 및 타입 추가 * style: 메인 - 레이아웃 수정 * style: 메인 - mou단체 소개 비어있는 부분 문구 추가 * style: 작품 등록하기 - 레이아웃 수정 * fix: 미로그인 후 좋아요 클릭 시 로그인 페이지로 이동 * fix: 미로그인 시 대본열람 막기 * style: 메인 - 작품등록하기 이미지 변경 * style: 메인 -작품 둘러보기, 공연권 신청하기 이미지 수정
1 parent 3dfef5c commit ea0712d

Some content is hidden

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

49 files changed

+3639
-2719
lines changed

package-lock.json

Lines changed: 2506 additions & 1619 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"react-dom": "^18.2.0",
2323
"react-draggable": "^4.4.6",
2424
"react-dropzone": "^14.2.3",
25+
"react-intersection-observer": "^9.16.0",
2526
"react-pdf": "^5.7.2",
2627
"react-router-dom": "^6.22.3",
2728
"react-spinners": "^0.14.1",

src/App.jsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import SignInV2 from "./pages/auth/SignInV2";
1515
import FindBar from "./pages/auth/FindBar";
1616

1717
import PostGallery from "./pages/work/postList/PostGallery";
18-
import PostGalleryShort from "./pages/work/postList/PostGalleryShort";
19-
import PostGalleryLong from "./pages/work/postList/PostGalleryLong";
2018

2119
import Detail from "./pages/work/Detail.tsx";
2220

@@ -40,8 +38,7 @@ import ScriptManageDetail from "./pages/myPage/PostManage/PostManageDetail";
4038
import AskedPerformManage from "./pages/myPage/AskedPerformManage";
4139
import AccountInfoChange from "./pages/myPage/AccountInfoChange";
4240
import LikedWorks from "./pages/myPage/Liked/LikedWorks";
43-
import LikedLong from "./pages/myPage/Liked/LikedLong";
44-
import LikedShort from "./pages/myPage/Liked/LikedShort";
41+
4542
import Loading from "./pages/Loading";
4643
import NotFound from "./pages/NotFound";
4744

@@ -84,8 +81,7 @@ function App() {
8481

8582
{/* <Route path="list" element={<List />} /> */}
8683
<Route path="list" element={<PostGallery />} />
87-
<Route path="list/long" element={<PostGalleryLong />} />
88-
<Route path="list/short" element={<PostGalleryShort />} />
84+
8985
<Route path="list/detail/:id" element={<Detail />} />
9086
<Route path="list/view/:id" element={<PostView />} />
9187
<Route
@@ -110,14 +106,7 @@ function App() {
110106
path="mypage/liked"
111107
element={<ProtectedRoute element={<LikedWorks />} />}
112108
/>
113-
<Route
114-
path="mypage/liked/long"
115-
element={<ProtectedRoute element={<LikedLong />} />}
116-
/>
117-
<Route
118-
path="mypage/liked/short"
119-
element={<ProtectedRoute element={<LikedShort />} />}
120-
/>
109+
121110
<Route
122111
path="mypage/purchased"
123112
element={<ProtectedRoute element={<PurchasedScript />} />}

src/api/user/postListApi.ts

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export interface ExploreScriptsResponse {
3131
}
3232

3333
export const fetchExploreScripts = async (
34-
accessToken?: string
34+
accessToken?: string,
35+
sortType: "POPULAR" | "LIKE_COUNT" | "LATEST" = "POPULAR"
3536
): Promise<ExploreScriptsResponse> => {
3637
try {
3738
const headers: Record<string, string> = {};
@@ -43,6 +44,9 @@ export const fetchExploreScripts = async (
4344
const response = await api.get<ExploreScriptsResponse>("/scripts", {
4445
headers,
4546
withCredentials: true, // 쿠키 인증 시 필요
47+
params: {
48+
sortType,
49+
},
4650
});
4751

4852
const { longPlay, shortPlay } = response.data;
@@ -58,36 +62,11 @@ export const fetchExploreScripts = async (
5862
}
5963
};
6064

61-
export const toggleLikeScript = async (
62-
id: string,
63-
accessToken?: string
64-
): Promise<"like" | "cancel like"> => {
65-
try {
66-
const headers: Record<string, string> = {
67-
"Content-Type": "application/json",
68-
};
69-
70-
if (accessToken) {
71-
headers["Authorization"] = `Bearer ${accessToken}`;
72-
}
73-
74-
const response = await api.post<{ message: "like" | "cancel like" }>(
75-
`/scripts/like/${id}`,
76-
null,
77-
{ headers, withCredentials: true }
78-
);
79-
80-
return response.data.message;
81-
} catch (error) {
82-
console.error("Error toggleLikeScript:", error);
83-
throw new Error(`좋아요 토글 실패: ${(error as Error).message}`);
84-
}
85-
};
86-
8765
// 좋아한 장편 작품 목록 조회
8866
export const getLongWorks = async (
8967
page: number = 0,
90-
accessToken?: string
68+
accessToken?: string,
69+
sortType: "POPULAR" | "LIKE_COUNT" | "LATEST" = "POPULAR"
9170
): Promise<ScriptItem[]> => {
9271
try {
9372
const headers: Record<string, string> = {};
@@ -97,7 +76,7 @@ export const getLongWorks = async (
9776
}
9877

9978
const response = await api.get<ScriptItem[]>(`/scripts/long`, {
100-
params: { page },
79+
params: { page, sortType },
10180
headers,
10281
});
10382
console.log(response);
@@ -111,7 +90,8 @@ export const getLongWorks = async (
11190
// 좋아한 장편 작품 목록 조회
11291
export const getShortWorks = async (
11392
page: number = 0,
114-
accessToken?: string
93+
accessToken?: string,
94+
sortType: "POPULAR" | "LIKE_COUNT" | "LATEST" = "POPULAR"
11595
): Promise<ScriptItem[]> => {
11696
try {
11797
const headers: Record<string, string> = {};
@@ -121,17 +101,43 @@ export const getShortWorks = async (
121101
}
122102

123103
const response = await api.get<ScriptItem[]>(`/scripts/short`, {
124-
params: { page },
104+
params: { page, sortType },
125105
headers,
126106
});
127-
107+
console.log(response);
128108
return response.data;
129109
} catch (error) {
130110
console.error("Error fetchin short works:", error);
131111
throw new Error(`단편 작품 API 호출 실패: ${(error as Error).message}`);
132112
}
133113
};
134114

115+
export const toggleLikeScript = async (
116+
id: string,
117+
accessToken?: string
118+
): Promise<"like" | "cancel like"> => {
119+
try {
120+
const headers: Record<string, string> = {
121+
"Content-Type": "application/json",
122+
};
123+
124+
if (accessToken) {
125+
headers["Authorization"] = `Bearer ${accessToken}`;
126+
}
127+
128+
const response = await api.post<{ message: "like" | "cancel like" }>(
129+
`/scripts/like/${id}`,
130+
null,
131+
{ headers, withCredentials: true }
132+
);
133+
134+
return response.data.message;
135+
} catch (error) {
136+
console.error("Error toggleLikeScript:", error);
137+
throw new Error(`좋아요 토글 실패: ${(error as Error).message}`);
138+
}
139+
};
140+
135141
export const getPostView = async (scriptId: string): Promise<Blob> => {
136142
try {
137143
const headers: Record<string, string> = {

src/assets/image/landing/page1.png

-1.34 MB
Binary file not shown.

src/assets/image/landing/page1.svg

Lines changed: 9 additions & 0 deletions
Loading
1 MB
Loading
1.02 MB
Loading
-159 KB
Binary file not shown.
1.15 MB
Loading

0 commit comments

Comments
 (0)