From 08c5c7bd60c6461d6324a97f9b1d504ba370d31b Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:06:22 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat=20:=20=EC=8B=A4=ED=96=89=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=9D=BC=20"=EC=A7=80=EC=9B=90?= =?UTF-8?q?=ED=95=98=EA=B8=B0"=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=EB=B6=80=20=EB=A0=8C=EB=8D=94=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useIsMobile.ts | 26 ++++++++++++++++++++++++++ src/pages/user/apply/Apply.tsx | 9 +++++++++ src/routes/AppRoutes.tsx | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/hooks/useIsMobile.ts diff --git a/src/hooks/useIsMobile.ts b/src/hooks/useIsMobile.ts new file mode 100644 index 00000000..38f40e56 --- /dev/null +++ b/src/hooks/useIsMobile.ts @@ -0,0 +1,26 @@ +import { useState, useEffect } from 'react'; + +const useIsMobile = () => { + const [isMobile, setIsMobile] = useState(false); + + useEffect(() => { + const checkIsMobile = () => { + setIsMobile(window.innerWidth <= 768); + }; + + // 초기 체크 + checkIsMobile(); + + // 리사이즈 이벤트 리스너 추가 + window.addEventListener('resize', checkIsMobile); + + // 클린업 함수 + return () => { + window.removeEventListener('resize', checkIsMobile); + }; + }, []); + + return isMobile; +}; + +export default useIsMobile; diff --git a/src/pages/user/apply/Apply.tsx b/src/pages/user/apply/Apply.tsx index 043074c4..98db5326 100644 --- a/src/pages/user/apply/Apply.tsx +++ b/src/pages/user/apply/Apply.tsx @@ -15,6 +15,8 @@ import LoadingSpinner from '../../../components/common/loadingSpinner/LoadingSpi import PhoneComponent from '../../../components/user/applyComponents/phoneComponent/PhoneComponent'; import CareersComponent from '../../../components/user/applyComponents/careersComponent/CareersComponent'; import Input from '../../../components/user/projectFormComponents/inputComponent/InputComponent'; +import ApplyStep from './ApplyStep'; +import useIsMobile from '../../../hooks/useIsMobile'; const Apply = () => { const { projectId } = useParams(); @@ -23,6 +25,7 @@ const Apply = () => { const { data: projectData, isLoading, isFetching } = useGetProjectData(id); const { applyProject } = useApplyProject({ id, handleModalOpen }); const userEmail = useAuthStore((state) => state.userData?.email); + const isMobile = useIsMobile(); const { handleSubmit: onSubmitHandler, @@ -65,6 +68,12 @@ const Apply = () => { if (isLoading) return ; if (isFetching) return ; + // 모바일 환경이면 ApplyStep 컴포넌트 렌더링 + if (isMobile) { + return ; + } + + // 데스크톱 환경이면 기존 Apply 컴포넌트 렌더링 return ( 프로젝트 지원 diff --git a/src/routes/AppRoutes.tsx b/src/routes/AppRoutes.tsx index df3f7d86..0f76821d 100644 --- a/src/routes/AppRoutes.tsx +++ b/src/routes/AppRoutes.tsx @@ -27,7 +27,7 @@ const Inquiry = lazy( ); const MyPage = lazy(() => import('../pages/user/mypage/MyPage')); const UserPage = lazy(() => import('../pages/user/userpage/UserPage')); -const Apply = lazy(() => import('../pages/user/apply/ApplyStep')); +const Apply = lazy(() => import('../pages/user/apply/Apply')); const CreateProject = lazy( () => import('../pages/user/createProject/CreateProject') ); From 331aed4b53b86e844f215f6602350ba39e2bee23 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:06:44 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat=20:=20=EB=A9=94=ED=83=80=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/avatar/Avatar.tsx | 5 ++- .../user/projectDetail/ProjectDetail.tsx | 40 +++++++++++++++++-- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/components/common/avatar/Avatar.tsx b/src/components/common/avatar/Avatar.tsx index 61accdcc..6b7e8e45 100644 --- a/src/components/common/avatar/Avatar.tsx +++ b/src/components/common/avatar/Avatar.tsx @@ -5,15 +5,16 @@ import defaultImg from '../../../assets/defaultImg.png'; export interface AvatarProps { size: string; image: string | ReactNode; + alt?: string; } -function Avatar({ size, image }: AvatarProps) { +function Avatar({ size, image, alt = '사용자 프로필 이미지' }: AvatarProps) { const releasedImg = typeof image === 'string' && image.trim() ? image : defaultImg; return ( {typeof image === 'string' || !image ? ( - + ) : ( image )} diff --git a/src/pages/user/projectDetail/ProjectDetail.tsx b/src/pages/user/projectDetail/ProjectDetail.tsx index d395f152..3e13bc4b 100644 --- a/src/pages/user/projectDetail/ProjectDetail.tsx +++ b/src/pages/user/projectDetail/ProjectDetail.tsx @@ -31,6 +31,29 @@ const ProjectDetail = () => { } }, [data, handleModalOpen, isLoading, isFetching]); + // 간단한 메타 정보 설정 + useEffect(() => { + if (data) { + document.title = `${data.title} - 프로젝트 상세`; + + // 메타 설명 추가 + const metaDescription = document.querySelector( + 'meta[name="description"]' + ); + if (metaDescription) { + metaDescription.setAttribute( + 'content', + `${data.title} 프로젝트에 대한 상세 정보입니다.` + ); + } else { + const newMetaDescription = document.createElement('meta'); + newMetaDescription.name = 'description'; + newMetaDescription.content = `${data.title} 프로젝트에 대한 상세 정보입니다.`; + document.head.appendChild(newMetaDescription); + } + } + }, [data]); + if (isLoading || isFetching) return ; if (!data) { @@ -63,7 +86,11 @@ const ProjectDetail = () => { {data.title} - + @@ -71,19 +98,21 @@ const ProjectDetail = () => { {formatDate(data.recruitmentEndDate)} - + {data.views} + -

+
+ {userData && userData.id !== data.user.id && @@ -99,7 +128,9 @@ const ProjectDetail = () => { ) : null} -
+ +
+ { />
+ Date: Sun, 27 Jul 2025 23:07:03 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix=20:=20=EB=8C=93=EA=B8=80=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=EA=B3=A7=EB=B0=94=EB=A1=9C=20=EC=B5=9C?= =?UTF-8?q?=EC=8B=A0=ED=99=94=20=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/user/CommentHooks/usePostComment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/user/CommentHooks/usePostComment.ts b/src/hooks/user/CommentHooks/usePostComment.ts index 5113c039..fffbf6a0 100644 --- a/src/hooks/user/CommentHooks/usePostComment.ts +++ b/src/hooks/user/CommentHooks/usePostComment.ts @@ -10,7 +10,7 @@ const usePostComment = (id: number) => { onSuccess: () => { queryClient.invalidateQueries({ queryKey: [ProjectCommentList.projectComment, id], - exact: true, + exact: false, }); }, onError: (error) => { From 247f9e98949b305c318f7cd65499637d19838a99 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:11:45 +0900 Subject: [PATCH 4/5] =?UTF-8?q?refactor=20:=20SEO=20=EC=B5=9C=EC=A0=81?= =?UTF-8?q?=ED=99=94=EB=A5=BC=20=EC=9C=84=ED=95=9C=20robots.txt=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/robots.txt | 8 ++++++++ public/sitemap.xml | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..6b71eeca --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,8 @@ +User-agent: * +Allow: / + +# Sitemap +Sitemap: https://www.devpals.site + +# Crawl-delay (선택사항) +Crawl-delay: 1 \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 00000000..3cb11ee5 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,21 @@ + + + + https://www.devpals.site/ + 2024-01-01 + daily + 1.0 + + + https://www.devpals.site/main + 2024-01-01 + daily + 0.9 + + + https://www.devpals.site + 2024-01-01 + weekly + 0.7 + + \ No newline at end of file From 5d8cc71e4fcb2614a28fef5f7802bdc788147211 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:16:40 +0900 Subject: [PATCH 5/5] =?UTF-8?q?refactor=20:=20=EC=82=AC=EC=9D=B4=ED=8A=B8?= =?UTF-8?q?=EB=A7=B5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/robots.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/robots.txt b/public/robots.txt index 6b71eeca..1cb1c273 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -2,7 +2,7 @@ User-agent: * Allow: / # Sitemap -Sitemap: https://www.devpals.site +Sitemap: https://www.devpals.site/sitemap.xml # Crawl-delay (선택사항) Crawl-delay: 1 \ No newline at end of file