Skip to content

Commit e3f356b

Browse files
committed
Merge branch 'dev' into feat/write#19
2 parents fabb821 + 4f91a4f commit e3f356b

Some content is hidden

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

56 files changed

+1107
-494
lines changed

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
4+
45
images: {
56
domains: ['team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com'],
67
remotePatterns: [

package-lock.json

Lines changed: 44 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
]
1919
},
2020
"dependencies": {
21+
"@tanstack/react-query": "^5.90.2",
2122
"@tanstack/react-virtual": "^3.13.12",
2223
"class-variance-authority": "^0.7.1",
2324
"gsap": "^3.13.0",
@@ -27,7 +28,8 @@
2728
"react-dom": "19.1.0",
2829
"react-hot-toast": "^2.6.0",
2930
"react-use": "^17.6.0",
30-
"swiper": "^12.0.2"
31+
"swiper": "^12.0.2",
32+
"react-intersection-observer": "^9.16.0"
3133
},
3234
"devDependencies": {
3335
"@eslint/eslintrc": "^3",

src/app/layout.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import KaKaoScript from './api/kakao/KaKaoScript';
88
import 'swiper/css';
99
import 'swiper/css/navigation';
1010
import 'swiper/css/pagination';
11+
import Provider from '@/shared/api/Provider';
12+
import ClientInitHook from '@/domains/login/components/ClientInitHook';
1113

1214
export const metadata: Metadata = {
1315
title: { default: 'SSOUL', template: 'SSOUL | %s' },
@@ -23,23 +25,26 @@ export default function RootLayout({
2325
return (
2426
<html lang="ko-KR">
2527
<body className="relative flex flex-col min-h-screen">
26-
<Header />
27-
<main className="flex flex-1 pt-[2.75rem] md:pt-[3.75rem]">{children}</main>
28-
<FooterWrapper />
28+
<Provider>
29+
<Header />
30+
<ClientInitHook />
31+
<main className="flex flex-1 pt-[2.75rem] md:pt-[3.75rem]">{children}</main>
32+
<FooterWrapper />
2933

30-
<div id="modal-root"></div>
31-
<Toaster
32-
position="top-center"
33-
toastOptions={{
34-
duration: 2000,
35-
style: {
36-
minWidth: '340px',
37-
background: 'transparent',
38-
},
39-
}}
40-
/>
34+
<div id="modal-root"></div>
35+
<Toaster
36+
position="top-center"
37+
toastOptions={{
38+
duration: 2000,
39+
style: {
40+
minWidth: '340px',
41+
background: 'transparent',
42+
},
43+
}}
44+
/>
4145

42-
<ScrollTopBtnWrapper />
46+
<ScrollTopBtnWrapper />
47+
</Provider>
4348
</body>
4449
<KaKaoScript />
4550
</html>

src/app/mypage/my-active/my-like/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export const metadata: Metadata = {
88
};
99

1010
function Page() {
11-
// return <MyLike />;
11+
return <MyLike />;
1212
}
1313
export default Page;

src/app/mypage/my-setting/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import MySetting from '@/domains/mypage/main/MySetting';
22

33
import { Metadata } from 'next';
44
export const metadata: Metadata = {
5-
title: 'SSOUL | 마이페이지',
5+
title: '마이페이지',
66
description: 'SSOUL 서비스에서 나의 활동을 관리할 수 있는 페이지입니다',
77
};
88

src/app/not-found.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
function notfound() {
2-
return <div>notfound</div>;
1+
import NotFoundCont from '@/domains/not-found/components/NotFoundCont';
2+
3+
function NotFound() {
4+
return (
5+
<div className="page-layout max-w-1024 flex-center">
6+
<NotFoundCont />
7+
</div>
8+
);
39
}
4-
export default notfound;
10+
export default NotFound;

src/domains/community/hook/useComment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function useComments(postId: ParamValue, user: User | null, accessToken:
2424
fetchData();
2525
}, [fetchData]);
2626

27-
const handleUpdateComment = async (commentId: number, postId: number, content: string) => {
27+
const handleUpdateComment = async (commentId: number, content: string) => {
2828
if (!user) {
2929
alert('로그인이 필요합니다');
3030
return;
@@ -44,7 +44,7 @@ export function useComments(postId: ParamValue, user: User | null, accessToken:
4444
}
4545
};
4646

47-
const handleAskDeleteComment = (commentId: number, postId: number) => {
47+
const handleAskDeleteComment = (commentId: number) => {
4848
setDeleteTarget({ commentId, postId });
4949
};
5050

src/domains/community/main/PostCard.tsx

Lines changed: 58 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ type Props = {
1414
posts: Post[] | null;
1515
setPost?: (value: Post[] | null) => void;
1616
isLoading: boolean;
17-
setIsLoading?: (value: boolean) => void;
18-
isEnd?: boolean;
19-
onLoadMore?: (lastPostId: number) => Promise<void>;
2017
};
2118

2219
function PostCard({ posts, isLoading, isEnd, onLoadMore }: Props) {
@@ -41,81 +38,65 @@ function PostCard({ posts, isLoading, isEnd, onLoadMore }: Props) {
4138

4239
return (
4340
<>
44-
{posts &&
45-
posts.map(
46-
(
47-
{
48-
postId,
49-
categoryName,
50-
title,
51-
content,
52-
userNickName,
53-
viewCount,
54-
createdAt,
55-
commentCount,
56-
imageUrls,
57-
},
58-
index
59-
) => {
60-
const isLast = index === posts.length - 1;
61-
return (
62-
<article
63-
className="py-4 sm:py-5 border-b-1 border-gray-light"
64-
key={postId}
65-
ref={(el) => {
66-
if (index === 0) firstItemRef.current = el;
67-
if (isLast) {
68-
observeLastItem(el);
69-
}
70-
}}
71-
>
72-
<Label title={categoryName} />
41+
{posts.map(
42+
({
43+
postId,
44+
categoryName,
45+
title,
46+
content,
47+
userNickName,
48+
viewCount,
49+
createdAt,
50+
commentCount,
51+
imageUrl,
52+
}) => (
53+
<article className="py-4 sm:py-5 border-b-1 border-gray-light" key={postId}>
54+
<Label title={categoryName} />
7355

74-
<section
75-
onClick={() => handlePost(postId)}
76-
className="flex items-center gap-3 justify-between mt-3 cursor-pointer h-full"
77-
role="link"
78-
>
79-
<div className="flex flex-col gap-3 md:max-w-[51.25rem] sm:max-w-[27.5rem] max-w-[19.375rem] flex-grow content-between h-full">
80-
<p className="font-bold sm:text-xl text-lg">{title}</p>
81-
<div className="font-light sm:text-[15px] text-sm md:max-w-[820px] sm:max-w-[440px] max-w-[210px] h-full">
82-
<p
83-
className="h-10 whitespace-pre-line"
84-
style={{
85-
display: '-webkit-box',
86-
WebkitBoxOrient: 'vertical',
87-
WebkitLineClamp: 2,
88-
overflow: 'hidden',
89-
textOverflow: 'ellipsis',
90-
}}
91-
>
92-
{content}
93-
</p>
94-
</div>
95-
<PostInfo
96-
hasUserName={true}
97-
userNickName={userNickName}
98-
viewCount={viewCount}
99-
createdAt={createdAt}
100-
commentCount={commentCount}
101-
/>
102-
</div>
103-
<figure className="flex items-center flex-shrink-0 md:w-[115px] md:h-[115px] w-[85px] h-[85px]">
104-
{imageUrls.length > 0 && (
105-
<Image
106-
src={imageUrls[0]}
107-
alt="예비사진"
108-
width={105}
109-
height={105}
110-
className="w-full h-full object-cover self-center rounded-md"
111-
/>
112-
)}
113-
</figure>
114-
</section>
115-
</article>
116-
);
117-
}
118-
)}
56+
<section
57+
onClick={() => handlePost(postId)}
58+
className="flex items-center gap-3 justify-between mt-3 cursor-pointer h-full"
59+
role="link"
60+
>
61+
<div className="flex flex-col gap-3 md:max-w-[51.25rem] sm:max-w-[27.5rem] max-w-[19.375rem] flex-grow content-between h-full">
62+
<p className="font-bold sm:text-xl text-lg">{title}</p>
63+
<div className="font-light sm:text-[15px] text-sm md:max-w-[820px] sm:max-w-[440px] max-w-[210px] h-full">
64+
<p
65+
className="h-10"
66+
style={{
67+
display: '-webkit-box',
68+
WebkitBoxOrient: 'vertical',
69+
WebkitLineClamp: 2,
70+
overflow: 'hidden',
71+
textOverflow: 'ellipsis',
72+
}}
73+
>
74+
{content}
75+
</p>
76+
</div>
77+
<PostInfo
78+
hasUserName={true}
79+
userNickName={userNickName}
80+
viewCount={viewCount}
81+
createdAt={createdAt}
82+
commentCount={commentCount}
83+
/>
84+
</div>
85+
<figure className="flex items-center flex-shrink-0 md:w-[115px] md:h-[115px] w-[85px] h-[85px]">
86+
{imageUrl && (
87+
<Image
88+
src={prePost}
89+
alt="예비사진"
90+
width={105}
91+
height={105}
92+
className="w-full h-full object-cover self-center"
93+
/>
94+
)}
95+
</figure>
96+
</section>
97+
</article>
98+
)
99+
)}
119100
</>
120101
);
121102
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use client';
2+
3+
import { useFetchInterceptor } from '@/shared/hook/useFetchInterceptor';
4+
import { useIdleLogout } from '../hook/useIdleLogout';
5+
6+
function ClientInitHook() {
7+
useIdleLogout();
8+
useFetchInterceptor();
9+
return null;
10+
}
11+
export default ClientInitHook;

0 commit comments

Comments
 (0)