Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
32 changes: 16 additions & 16 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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>
<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>
<url><loc>https://www.workroot.life/login</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/addform</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/signup</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<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>
<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>
<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>
<url><loc>https://www.workroot.life/mypage</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<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>
<url><loc>https://www.workroot.life</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<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>
<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>
<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>
<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>
<url><loc>https://www.workroot.life/privacy</loc><lastmod>2024-12-24T02:01:26.332Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life</loc><lastmod>2024-12-24T07:00:52.975Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/signup/owner</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/login</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/signup/applicant</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/signup</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/my-workform/applicant</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/work-talk/add</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/privacy</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/auth/callback</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/mypage</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/work-talk</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/stories/design-system/pages/albaList</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/my-workform</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/addform</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/my-workform/owner</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.workroot.life/work-list</loc><lastmod>2024-12-24T07:00:52.977Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
2 changes: 1 addition & 1 deletion src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { motion, AnimatePresence } from "framer-motion";
import Image from "next/image";
import Lenis from "@studio-freight/lenis";
import { useMediaQuery } from "react-responsive";
import TypewriterText from "../components/animation/typewriterText";
import TypewriterText from "../components/animation/TypewriterText";

const slides = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/(workform)/apply/[formId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function Apply() {
await queryClient.invalidateQueries({ queryKey: ["formDetail", formId] });

toast.success("지원이 완료되었습니다.");
router.push("/my-workform");
router.push(`/work/${formId}`);
},

onError: (error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ContentSection from "@/app/components/layout/ContentSection";
import useWidth from "@/hooks/useWidth";
import ScrollTopButton from "@/app/components/button/default/ScrollTopButton";
import SamllLoadingSpinner from "@/app/components/loading-spinner/SmallLoadingSpinner";
import LoadingSpinner from "@/app/components/loading-spinner/LoadingSpinner";

export default function CommentsSection() {
const [currentPage, setCurrentPage] = useState(1);
Expand Down Expand Up @@ -43,6 +44,10 @@ export default function CommentsSection() {
window.scrollTo(0, 0);
};

if (isLoading) {
return <LoadingSpinner />;
}

if (error) {
return (
<div className="flex h-[calc(100vh-300px)] items-center justify-center">
Expand Down
16 changes: 14 additions & 2 deletions src/app/(pages)/mypage/components/sections/PostsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import ScrollTopButton from "@/app/components/button/default/ScrollTopButton";
import BoardPostItem from "@/app/components/card/board/BoardPostItem";
import DotLoadingSpinner from "@/app/components/loading-spinner/DotLoadingSpinner";
import SamllLoadingSpinner from "@/app/components/loading-spinner/SmallLoadingSpinner";
import LoadingSpinner from "@/app/components/loading-spinner/LoadingSpinner";
import { useUser } from "@/hooks/queries/user/me/useUser";

export default function PostsSection() {
const { orderBy } = useMySortStore();
Expand All @@ -36,7 +38,7 @@ export default function PostsSection() {
limit: postsPerPage,
orderBy: orderBy.posts,
});

const { user } = useUser();
useEffect(() => {
if (inView && hasNextPage && !isFetchingNextPage) {
fetchNextPage();
Expand All @@ -51,6 +53,10 @@ export default function PostsSection() {
);
}

if (isLoading) {
return <LoadingSpinner />;
}

return (
<div className="flex flex-col items-center">
{/* 메인 콘텐츠 영역 */}
Expand All @@ -70,7 +76,13 @@ export default function PostsSection() {
{data.pages.map((page) => (
<React.Fragment key={page.nextCursor}>
{page.data.map((post) => (
<BoardPostItem post={post} key={post.id} />
<BoardPostItem
post={post}
key={post.id}
isAuthor={!!(post.writer.id === user?.id)}
limit={postsPerPage}
orderBy={orderBy.posts}
/>
))}
</React.Fragment>
))}
Expand Down
8 changes: 8 additions & 0 deletions src/app/(pages)/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import CommentsSection from "./components/sections/CommentsSection";
import ScrapsSection from "./components/sections/ScrapsSection";
import { userRoles } from "@/constants/userRoles";
import { useUser } from "@/hooks/queries/user/me/useUser";
import toast from "react-hot-toast";
import { useRouter } from "next/navigation";

export default function MyPage() {
const searchParams = useSearchParams();
const currentTab = searchParams.get("tab") || "posts";
const router = useRouter();
const { user } = useUser();
const isApplicant = user?.role === userRoles.APPLICANT;

Expand All @@ -19,5 +22,10 @@ export default function MyPage() {
...(isApplicant && { scrap: <ScrapsSection /> }),
}[currentTab];

if (!user) {
toast.error("로그인이 필요한 페이지입니다.");
router.push("/login");
}

return TabContent;
}
12 changes: 8 additions & 4 deletions src/app/components/button/dropdown/KebabDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ const KebabDropdown = ({ options, className = "" }: KebabDropdownProps) => {
<div ref={dropdownRef} className={cn("relative inline-block text-left", className)}>
<button
type="button"
onClick={() => setIsOpen(!isOpen)}
className="rounded-full hover:bg-grayscale-50"
onClick={(e) => {
setIsOpen(!isOpen);
e.stopPropagation();
}}
className="rounded-full transition-transform hover:scale-125 hover:bg-grayscale-50"
aria-label="메뉴 더보기"
>
<BsThreeDotsVertical className="text-sm text-grayscale-200 lg:text-xl" />
<BsThreeDotsVertical className="text-md text-grayscale-200 lg:text-xl" />
</button>

{isOpen && (
Expand All @@ -42,7 +45,8 @@ const KebabDropdown = ({ options, className = "" }: KebabDropdownProps) => {
<button
type="button"
key={`${index}-${option.label}`}
onClick={() => {
onClick={(e) => {
e.stopPropagation();
option.onClick();
setIsOpen(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/card/board/BoardComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const BoardComment = ({

return (
<Link href={`work-talk/${postId}`}>
<div className="relative flex h-[202px] w-[327px] flex-col gap-2 rounded-[16px] border border-line-200 bg-grayscale-50 p-6 shadow-md md:w-[600px] lg:h-[264px] lg:w-full">
<div className="relative flex h-[202px] w-[327px] flex-col gap-2 rounded-[16px] border border-line-200 bg-grayscale-50 p-6 shadow-md transition-transform hover:scale-105 md:w-[600px] lg:h-[264px] lg:w-full">
{/* Post Section */}
<div className="flex w-full flex-col gap-4 border-b border-line-100 pb-2 lg:pb-4">
<div className="flex items-center gap-[6px] lg:gap-2">
Expand Down
61 changes: 59 additions & 2 deletions src/app/components/card/board/BoardPostItem.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,71 @@
"use client";
import { PostListType } from "@/types/response/post";
import { formatLocalDate } from "@/utils/workDayFormatter";
import Image from "next/image";
import Link from "next/link";
import KebabDropdown from "../../button/dropdown/KebabDropdown";
import { useRouter } from "next/navigation";
import useModalStore from "@/store/modalStore";
import { useDeleteComment } from "@/hooks/queries/post/comment/useDeleteComment";
import { useQueryClient } from "@tanstack/react-query";

const BoardPostItem = ({
post,
isAuthor,
limit,
orderBy,
}: {
post: PostListType;
isAuthor: boolean;
limit: number;
orderBy: string;
}) => {
const router = useRouter();
const deleteComment = useDeleteComment(String(post.id));
const queryClient = useQueryClient();
const { openModal, closeModal } = useModalStore();

const handleDelete = () => {
openModal("customForm", {
isOpen: true,
title: "게시글을 삭제할까요?",
content: "삭제된 게시글은 복구할 수 없습니다.",
confirmText: "삭제하기",
cancelText: "취소",
onConfirm: () => {
deleteComment.mutate(undefined, {
onSuccess: async () => {
await queryClient.invalidateQueries({ queryKey: ["post"] });
await queryClient.invalidateQueries({ queryKey: ["myPosts", { limit, orderBy }] });
closeModal();
},
});
},
onCancel: () => {
closeModal();
},
});
};

const dropdownOptions = [
{
label: "수정하기",
onClick: () => router.push(`/work-talk/${post.id}/edit`),
},
{
label: "삭제하기",
onClick: handleDelete,
},
];

const BoardPostItem = ({ post }: { post: PostListType }) => {
return (
<Link
href={`/work-talk/${post.id}`}
className="block cursor-pointer transition-transform duration-300 hover:scale-[1.02]"
>
<div className="relative flex h-[202px] min-w-[327px] flex-col justify-between rounded-[16px] border border-line-200 bg-grayscale-50 p-6 shadow-md md:w-[600px] lg:h-[264px] lg:w-full">
<div className="flex flex-col gap-2">
<h3 className="text-[16px] font-semibold text-black-400 lg:text-[20px]">{post.title}</h3>
<h3 className="line-clamp-1 text-[16px] font-semibold text-black-400 lg:text-[20px]">{post.title}</h3>
<p className="line-clamp-3 overflow-hidden text-[14px] text-grayscale-500 lg:text-[18px]">{post.content}</p>
</div>

Expand Down Expand Up @@ -48,6 +102,9 @@ const BoardPostItem = ({ post }: { post: PostListType }) => {
</div>
</div>
</div>
<div className="absolute right-3 top-6 size-9 bg-white text-center" onClick={(e) => e.stopPropagation()}>
{isAuthor && <KebabDropdown options={dropdownOptions} />}
</div>
</div>
</Link>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/card/cardList/AlbaListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const AlbaListItem = ({
<BsThreeDotsVertical className="h-6 w-6" />
</button>
{showDropdown && (
<div className="absolute right-0 top-8 z-10 w-32 rounded-lg border border-grayscale-200 bg-white py-2 shadow-lg">
<div className="absolute right-0 top-8 z-10 w-32 overflow-hidden rounded-lg border border-grayscale-200 bg-white shadow-lg">
{isApplicant ? (
<>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const MyApplicationListItem = ({ createdAt, status, resumeId, resumeName, form }
</div>

{/* 공고 제목 */}
<div className="text-grayscale-900 text-lg font-bold md:text-xl">{form.title}</div>
<div className="text-grayscale-900 line-clamp-1 text-lg font-bold md:text-xl">{form.title}</div>

{/* 공고 설명 (2줄 제한) */}
<p className="text-grayscale-600 line-clamp-2 h-[48px] text-sm md:line-clamp-2 md:text-base">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ const post = {
createdAt: new Date(),
};
export const Default: Story = {
args: { post },
args: { post, isAuthor: true, limit: 10, orderBy: "최신순" },
};
Loading