Skip to content

Commit 96e5b1c

Browse files
committed
Merge branch 'dev' of https://github.com/FE9-2/workroot into design/landing-fix
2 parents 3778a5a + 5d311c4 commit 96e5b1c

File tree

12 files changed

+1352
-5085
lines changed

12 files changed

+1352
-5085
lines changed

package-lock.json

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

public/sitemap.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
3-
<url><loc>https://www.workroot.life/login</loc><lastmod>2024-12-23T05:31:01.038Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4-
<url><loc>https://www.workroot.life/signup/owner</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5-
<url><loc>https://www.workroot.life/signup/applicant</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6-
<url><loc>https://www.workroot.life/signup</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7-
<url><loc>https://www.workroot.life</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8-
<url><loc>https://www.workroot.life/my-workform/applicant</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9-
<url><loc>https://www.workroot.life/my-workform/owner</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10-
<url><loc>https://www.workroot.life/my-workform</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11-
<url><loc>https://www.workroot.life/mypage</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12-
<url><loc>https://www.workroot.life/addform</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13-
<url><loc>https://www.workroot.life/work-list</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14-
<url><loc>https://www.workroot.life/work-talk/add</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15-
<url><loc>https://www.workroot.life/work-talk</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16-
<url><loc>https://www.workroot.life/auth/callback</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17-
<url><loc>https://www.workroot.life/stories/design-system/pages/albaList</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18-
<url><loc>https://www.workroot.life/privacy</loc><lastmod>2024-12-23T05:31:01.040Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
3+
<url><loc>https://www.workroot.life/signup/applicant</loc><lastmod>2024-12-24T02:01:26.330Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
<url><loc>https://www.workroot.life/signup/owner</loc><lastmod>2024-12-24T02:01:26.331Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5+
<url><loc>https://www.workroot.life/login</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6+
<url><loc>https://www.workroot.life/addform</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7+
<url><loc>https://www.workroot.life/signup</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8+
<url><loc>https://www.workroot.life/my-workform/applicant</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9+
<url><loc>https://www.workroot.life/my-workform</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10+
<url><loc>https://www.workroot.life/my-workform/owner</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11+
<url><loc>https://www.workroot.life/mypage</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12+
<url><loc>https://www.workroot.life/work-list</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13+
<url><loc>https://www.workroot.life</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14+
<url><loc>https://www.workroot.life/auth/callback</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15+
<url><loc>https://www.workroot.life/work-talk</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16+
<url><loc>https://www.workroot.life/work-talk/add</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17+
<url><loc>https://www.workroot.life/stories/design-system/pages/albaList</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18+
<url><loc>https://www.workroot.life/privacy</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
1919
</urlset>

src/app/(pages)/work-talk/[talkId]/edit/page.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ import DotLoadingSpinner from "@/app/components/loading-spinner/DotLoadingSpinne
1313
import { PostSchema } from "@/schemas/postSchema";
1414
import toast from "react-hot-toast";
1515
import LoadingSpinner from "@/app/components/loading-spinner/LoadingSpinner";
16+
import { useQueryClient } from "@tanstack/react-query";
1617

1718
interface ImageInputType {
1819
file: File | null;
1920
url: string;
2021
id: string;
2122
}
2223

23-
export default function EditTalk({ params }: { params: { albatalkId: string } }) {
24+
export default function EditTalk({ params }: { params: { talkId: string } }) {
2425
const [imageList, setImageList] = useState<ImageInputType[]>([]);
2526
const router = useRouter();
26-
const postId = params.albatalkId;
27+
const postId = params.talkId;
2728

2829
const { data: post, isLoading, error } = usePostDetail(postId);
2930
const { mutate: editPost, isPending } = useEditPost(postId);
31+
const queryClient = useQueryClient();
3032

3133
const {
3234
control,
@@ -124,7 +126,19 @@ export default function EditTalk({ params }: { params: { albatalkId: string } })
124126
};
125127

126128
editPost(postData, {
127-
onSuccess: () => {
129+
onSuccess: async () => {
130+
await queryClient.invalidateQueries({
131+
queryKey: [
132+
"posts",
133+
{
134+
limit: 10,
135+
orderBy: null,
136+
},
137+
],
138+
});
139+
await queryClient.invalidateQueries({
140+
queryKey: ["post", postId],
141+
});
128142
router.push(`/work-talk/${postId}`);
129143
},
130144
});
@@ -235,7 +249,7 @@ export default function EditTalk({ params }: { params: { albatalkId: string } })
235249
취소
236250
</Button>
237251
<Button
238-
className="h-[58px] w-full rounded-[8px] bg-primary-orange-300 text-white hover:bg-orange-400"
252+
className="h-[58px] w-full rounded-[8px] bg-primary-orange-300 text-white hover:bg-primary-orange-400"
239253
onClick={handleSubmit(onSubmit)}
240254
disabled={isPending}
241255
>

src/app/(pages)/work-talk/[talkId]/sections/CommentsSection.tsx

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useUser } from "@/hooks/queries/user/me/useUser";
1010
import { useComments } from "@/hooks/queries/post/comment/useComments";
1111
import Pagination from "@/app/components/pagination/Pagination";
1212
import DotLoadingSpinner from "@/app/components/loading-spinner/DotLoadingSpinner";
13+
import { usePostDetail } from "@/hooks/queries/post/usePostDetail";
1314

1415
interface CommentsSectionProps {
1516
postId: string;
@@ -29,6 +30,8 @@ export function CommentsSection({ postId }: CommentsSectionProps): JSX.Element {
2930
pageSize: 10,
3031
});
3132

33+
const { isLoading } = usePostDetail(postId);
34+
3235
const addComment = useAddComment(postId);
3336

3437
const handleAddComment = useCallback(() => {
@@ -50,7 +53,8 @@ export function CommentsSection({ postId }: CommentsSectionProps): JSX.Element {
5053
}
5154
}, []);
5255

53-
if (isCommentsLoading) {
56+
if (isCommentsLoading && !isLoading) {
57+
// 로딩 스피너 중복 방지
5458
return (
5559
<div className="flex h-[200px] items-center justify-center">
5660
<DotLoadingSpinner />
@@ -64,57 +68,59 @@ export function CommentsSection({ postId }: CommentsSectionProps): JSX.Element {
6468

6569
return (
6670
<section className="w-full" aria-label="댓글 섹션">
67-
<div className="mb-6 text-[16px] font-semibold text-black-400 md:text-[20px] lg:text-[24px]">
68-
댓글({commentsData?.totalItemCount ?? 0})
69-
</div>
71+
{!isLoading && (
72+
<>
73+
<div className="mb-6 text-[16px] font-semibold text-black-400 md:text-[20px] lg:text-[24px]">
74+
댓글({commentsData?.totalItemCount ?? 0})
75+
</div>
7076

71-
<BaseTextArea
72-
name="newComment"
73-
placeholder="댓글을 입력해주세요."
74-
value={newComment}
75-
onChange={(e) => setNewComment(e.target.value)}
76-
size="h-[120px] w-full lg:h-[144px]"
77-
variant="white"
78-
/>
79-
<div className="flex justify-end pb-10 pt-4">
80-
<Button
81-
onClick={handleAddComment}
82-
disabled={addComment.isPending || !newComment.trim()}
83-
className="h-[50px] w-[108px] rounded-lg text-[14px] font-medium lg:h-[64px] lg:w-[214px] lg:text-lg"
84-
>
85-
{addComment.isPending ? <DotLoadingSpinner /> : "등록하기"}
86-
</Button>
87-
</div>
77+
<BaseTextArea
78+
name="newComment"
79+
placeholder="댓글을 입력해주세요."
80+
value={newComment}
81+
onChange={(e) => setNewComment(e.target.value)}
82+
size="h-[120px] w-full lg:h-[144px]"
83+
variant="white"
84+
/>
85+
<div className="flex justify-end pb-10 pt-4">
86+
<Button
87+
onClick={handleAddComment}
88+
disabled={addComment.isPending || !newComment.trim()}
89+
className="h-[50px] w-[108px] rounded-lg text-[14px] font-medium lg:h-[64px] lg:w-[214px] lg:text-lg"
90+
>
91+
{addComment.isPending ? <DotLoadingSpinner /> : "등록하기"}
92+
</Button>
93+
</div>
8894

89-
<div className="mb-6">
90-
{commentsData?.data?.length ? (
91-
<>
92-
{commentsData.data.map((comment) => (
93-
<Comment
94-
key={comment.id}
95-
id={comment.id.toString()}
96-
nickname={comment.writer.nickname}
97-
updatedAt={comment.createdAt}
98-
content={comment.content}
99-
isAuthor={comment.writer.id === user?.id}
100-
/>
101-
))}
102-
</>
103-
) : (
104-
<div className="flex min-h-[300px] flex-col items-center justify-center gap-4 rounded-lg bg-white p-5">
105-
<Image src="/images/emptyComment-md.svg" alt="No comments" width={206} height={204} className="mb-4" />
95+
<div className="mb-6">
96+
{commentsData?.data?.length ? (
97+
commentsData.data.map((comment) => (
98+
<Comment
99+
key={comment.id}
100+
id={comment.id.toString()}
101+
nickname={comment.writer.nickname}
102+
updatedAt={comment.createdAt}
103+
content={comment.content}
104+
isAuthor={comment.writer.id === user?.id}
105+
/>
106+
))
107+
) : (
108+
<div className="flex min-h-[300px] flex-col items-center justify-center gap-4 rounded-lg bg-white p-5">
109+
<Image src="/images/emptyComment-md.svg" alt="No comments" width={206} height={204} className="mb-4" />
110+
</div>
111+
)}
106112
</div>
107-
)}
108-
</div>
109113

110-
{(commentsData?.totalPages ?? 0) > 1 && (
111-
<div className="mt-12 flex justify-center">
112-
<Pagination
113-
currentPage={currentPage}
114-
totalPage={commentsData?.totalPages ?? 0}
115-
onPageChange={handlePageChange}
116-
/>
117-
</div>
114+
{(commentsData?.totalPages ?? 0) > 1 && (
115+
<div className="mt-12 flex justify-center">
116+
<Pagination
117+
currentPage={currentPage}
118+
totalPage={commentsData?.totalPages ?? 0}
119+
onPageChange={handlePageChange}
120+
/>
121+
</div>
122+
)}
123+
</>
118124
)}
119125
</section>
120126
);

src/app/(pages)/work-talk/[talkId]/sections/PostDetailSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import useModalStore from "@/store/modalStore";
1010
import useWidth from "@/hooks/useWidth";
1111
import { usePostDetail } from "@/hooks/queries/post/usePostDetail";
1212
import { useRouter } from "next/navigation";
13+
import LoadingSpinner from "@/app/components/loading-spinner/LoadingSpinner";
1314

1415
export function PostDetailSection({ postId }: { postId: string }) {
1516
const { isDesktop } = useWidth();
1617
const { user } = useUser();
1718
const router = useRouter();
18-
const { data: post } = usePostDetail(postId);
19+
const { data: post, isLoading } = usePostDetail(postId);
1920
const { likePost, unlikePost } = useLikePost(postId);
2021
const deletePost = useDeletePost(postId);
2122
const { openModal, closeModal } = useModalStore();
@@ -58,6 +59,8 @@ export function PostDetailSection({ postId }: { postId: string }) {
5859
{ label: "삭제하기", onClick: handleDelete, disabled: deletePost.isPending },
5960
];
6061

62+
if (isLoading) return <LoadingSpinner />;
63+
6164
return (
6265
<section className="mb-12 w-full rounded-lg bg-white">
6366
{/* Header */}

src/app/(pages)/work-talk/add/page.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import axios from "axios";
1111
import DotLoadingSpinner from "@/app/components/loading-spinner/DotLoadingSpinner";
1212
import { PostSchema } from "@/schemas/postSchema";
1313
import toast from "react-hot-toast";
14+
import { QueryClient, useQueryClient } from "@tanstack/react-query";
1415

1516
interface ImageInputType {
1617
file: File | null;
@@ -29,7 +30,7 @@ export default function AddTalk() {
2930
const [imageList, setImageList] = useState<ImageInputType[]>([]);
3031
const router = useRouter();
3132
const { mutate: createPost, isPending } = useAddPost();
32-
33+
const queryClient = useQueryClient();
3334
const uploadImage = useCallback(async (file: File): Promise<string> => {
3435
const formData = new FormData();
3536
formData.append("image", file);
@@ -76,7 +77,16 @@ export default function AddTalk() {
7677
};
7778

7879
createPost(postData, {
79-
onSuccess: (response) => {
80+
onSuccess: async (response) => {
81+
await queryClient.invalidateQueries({
82+
queryKey: [
83+
"posts",
84+
{
85+
limit: 10,
86+
orderBy: null,
87+
},
88+
],
89+
});
8090
router.push(`/work-talk/${response.id}`);
8191
},
8292
});
@@ -175,7 +185,7 @@ export default function AddTalk() {
175185
취소
176186
</Button>
177187
<Button
178-
className="h-[58px] w-full rounded-[8px] bg-primary-orange-300 text-white hover:bg-orange-400"
188+
className="h-[58px] w-full rounded-[8px] bg-primary-orange-300 text-white hover:bg-primary-orange-400"
179189
onClick={handleSubmit(onSubmit)}
180190
disabled={isPending}
181191
>

src/app/(pages)/work-talk/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default function AlbaTalk() {
136136
{data?.pages.map((page) => (
137137
<React.Fragment key={page.nextCursor}>
138138
{page.data.map((post) => (
139-
<div className="cursor-pointer" key={post.id} onClick={() => handlePostClick(post.id)}>
139+
<div key={post.id} onClick={() => handlePostClick(post.id)}>
140140
<CardBoard
141141
id={post.id.toString()}
142142
title={post.title}

src/app/components/card/board/CardBoard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const CardBoard = ({
8686

8787
return (
8888
<div
89-
className={`h-[220px] w-[320px] rounded-[16px] border p-4 shadow-md lg:h-[240px] lg:w-[360px] ${
89+
className={`h-[220px] w-[320px] rounded-[16px] border p-4 shadow-md transition-transform duration-300 hover:scale-[1.02] lg:h-[240px] lg:w-[360px] ${
9090
variant === "primary" ? "border-primary-orange-100 bg-primary-orange-50" : "border-line-200 bg-grayscale-50"
9191
} cursor-pointer`}
9292
role="button"

src/app/components/card/board/Comment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ const Comment = ({ id, nickname, updatedAt, content, isAuthor = false }: Comment
7777
value={editedContent}
7878
onChange={(e) => setEditedContent(e.target.value)}
7979
placeholder="댓글을 입력해주세요."
80-
className="h-[90px] w-[344px] resize-none rounded-lg bg-background-200 p-4 md:w-[742px] lg:h-[100px] lg:w-[994px]"
81-
size="h-[120px] w-[375px] md:w-[768px] lg:w-[1024px] lg:h-[144px]"
80+
size="h-[120px] w-full lg:h-[144px]"
81+
innerClassName="bg-transparent"
8282
variant="white"
8383
/>
8484
<div className="flex justify-end gap-2">

src/app/components/input/file/ImageInput/ImageInputPlaceHolder.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ const ImageInputPlaceHolder: React.FC<ImageInputPlaceHolderProps> = ({
7979
<HiUpload className="text-[36px] text-grayscale-200" />
8080
<p className="mt-2 text-grayscale-500">이미지 넣기</p>
8181
</button>
82-
<input ref={fileInputRef} type="file" className="hidden" onChange={handleFileChange} accept="image/*" />
82+
<input
83+
ref={fileInputRef}
84+
type="file"
85+
multiple
86+
className="hidden"
87+
onChange={handleFileChange}
88+
accept="image/*"
89+
/>
8390
</div>
8491
{imageList.map((image) => (
8592
<PreviewItem key={image.id} image={image} handleDeleteImage={handleDeleteImage} placeholder={true} />

0 commit comments

Comments
 (0)