diff --git a/components/common/comment/CommentUserInfo.tsx b/components/common/comment/CommentUserInfo.tsx index bda37cfa..ce76a5a8 100644 --- a/components/common/comment/CommentUserInfo.tsx +++ b/components/common/comment/CommentUserInfo.tsx @@ -17,9 +17,7 @@ export default function CommentUserInfo({ className }: { className?: string }) {

) : ( // TODO: 추후 서버 수정되면 익명회원 ID를 보여주는 문구 추가 -

- 익명의 댑댑이님 의견을 남겨주세요! -

+ <> )} ); diff --git a/pages/_app.page.tsx b/pages/_app.page.tsx index 31291867..fc0dc771 100644 --- a/pages/_app.page.tsx +++ b/pages/_app.page.tsx @@ -8,11 +8,9 @@ import { QueryClient, QueryClientProvider, HydrationBoundary } from '@tanstack/r import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import Layout from '@components/common/layout'; -import MetaHead from '@components/meta/MetaHead'; import useSetAxiosConfig from '@/api/useSetAxiosConfig'; import { DAY, HALF_DAY } from '@/constants/TimeConstants'; -import { META } from '@/constants/metaData'; import { MediaQueryProvider } from '@/contexts/MediaQueryContext'; import '@/styles/globals.css'; @@ -56,29 +54,18 @@ export default function MyApp({ Component, pageProps }: AppProps) { }; }, [router.events]); - const meta = pageProps.meta || META.MAIN; - return ( - <> - - - - - - - - - - - - - - + + + + + + + + + + + + ); } diff --git a/pages/main/index.page.tsx b/pages/main/index.page.tsx index 0dc662c4..18e0b69e 100644 --- a/pages/main/index.page.tsx +++ b/pages/main/index.page.tsx @@ -8,10 +8,10 @@ import DevGuriError from '@components/common/error/DevGuriError'; import ArrowWithTitle from '@components/common/title/ArrowWithTitle'; import MainTechBlogSection from '@components/features/main/MainTechBlogSection'; import MainCardComponent from '@components/features/main/mainCard/MainCardComponent'; +import MetaHead from '@components/meta/MetaHead'; import DevLogo from '@public/image/devdevdevLogo.svg'; -import { META } from '@/constants/metaData'; import { useMediaQueryContext } from '@/contexts/MediaQueryContext'; const DynamicPickComponent = dynamic( @@ -39,63 +39,58 @@ export default function Index() { }; return ( -
- + <> + +
+ -
-
- -
- - ( - - )} - > - - -
-
+
+
+ +
+ + ( + + )} + > + + +
+
-
- -
- - ( - - )} - > - - -
-
+
+ +
+ + ( + + )} + > + + +
+
+
-
+ ); } - -export function getStaticProps() { - return { - props: { - meta: META.MAIN, - }, - }; -} \ No newline at end of file diff --git a/pages/pickpickpick/index.page.tsx b/pages/pickpickpick/index.page.tsx index 7ffc280d..b9d59de7 100644 --- a/pages/pickpickpick/index.page.tsx +++ b/pages/pickpickpick/index.page.tsx @@ -17,6 +17,7 @@ import { Dropdown } from '@components/common/dropdowns/dropdown'; import MobileDropdown from '@components/common/dropdowns/mobileDropdown'; import { LoginModal } from '@components/common/modals/modal'; import { MobilePickSkeletonList, PickSkeletonList } from '@components/common/skeleton/pickSkeleton'; +import MetaHead from '@components/meta/MetaHead'; import IconPencil from '@public/image/pencil-alt.svg'; @@ -41,6 +42,8 @@ export default function Index() { const { isMobile } = useMediaQueryContext(); + const { title, description, keyword, url } = META.PICK; + const { pickData, isFetchingNextPage, hasNextPage, status, onIntersect } = useInfinitePickData( sortOption as PickDropdownProps, ); @@ -102,68 +105,63 @@ export default function Index() { }; return ( -
-
-

- 픽픽픽 💘 -

- - {!isMobile && ( -
- - - {loginStatus === 'login' ? ( - + <> + +
+
+

+ 픽픽픽 💘 +

+ + {!isMobile && ( +
+ + + {loginStatus === 'login' ? ( + + } + type='button' + /> + + ) : ( } + onClick={() => { + openLoginModal(); + setDescription('댑댑이가 되면 픽픽픽을 작성할 수 있어요 🥳'); + }} type='button' /> - - ) : ( - } - onClick={() => { - openLoginModal(); - setDescription('댑댑이가 되면 픽픽픽을 작성할 수 있어요 🥳'); - }} - type='button' - /> - )} -
- )} + )} +
+ )} +
+ {getStatusComponent()} +
+ {isMobile && + (loginStatus === 'login' ? ( + + + + ) : ( + { + openLoginModal(); + setDescription('댑댑이가 되면 픽픽픽을 작성할 수 있어요 🥳'); + }} + /> + ))} + {isLoginModalOpen && loginStatus !== 'login' && }
- {getStatusComponent()} -
- {isMobile && - (loginStatus === 'login' ? ( - - - - ) : ( - { - openLoginModal(); - setDescription('댑댑이가 되면 픽픽픽을 작성할 수 있어요 🥳'); - }} - /> - ))} - {isLoginModalOpen && loginStatus !== 'login' && } -
+ ); } - -export function getStaticProps() { - return { - props: { - meta: META.PICK, - }, - }; -} \ No newline at end of file diff --git a/pages/techblog/[id]/index.page.tsx b/pages/techblog/[id]/index.page.tsx index a0c3fa36..b367cd6b 100644 --- a/pages/techblog/[id]/index.page.tsx +++ b/pages/techblog/[id]/index.page.tsx @@ -1,10 +1,7 @@ import React from 'react'; -import { GetServerSidePropsContext } from 'next'; import { useRouter } from 'next/router'; -import { QueryClient, dehydrate } from '@tanstack/react-query'; - import DevLoadingComponent from '@pages/loading/index.page'; import { useLoginStatusStore } from '@stores/loginStore'; @@ -20,49 +17,13 @@ import { LoginModal } from '@components/common/modals/modal'; import { ROUTES } from '@/constants/routes'; import { useMediaQueryContext } from '@/contexts/MediaQueryContext'; -import { getDetailTechBlog, useGetDetailTechBlog } from '../api/useGetTechBlogDetail'; +import { useGetDetailTechBlog } from '../api/useGetTechBlogDetail'; import { usePostMainComment } from '../api/usePostComment'; import CommentTechSection from '../components/CommentTechSection'; import CompanyInfoCard from '../components/CompanyInfoCard'; import TechDetailCard from '../components/TechDetailCard'; import { TechCardProps } from '../types/techBlogType'; -export async function getServerSideProps(context: GetServerSidePropsContext) { - const id = context.params?.id; - - if (!id || typeof id !== 'string') { - return { - notFound: true, - }; - } - - const queryClient = new QueryClient(); - - try { - const postData = await getDetailTechBlog(id); - const post = postData.data; - - await queryClient.setQueryData(['techDetail', id], postData); - - const meta = { - title: post.title, - description: post.contents.substring(0, 150) + '...', - }; - - return { - props: { - dehydratedState: dehydrate(queryClient), - meta: meta, - }, - }; - } catch (error) { - console.error(`Error fetching post data for id: ${id}`, error); - return { - notFound: true, - }; - } -} - export default function Page() { const router = useRouter(); const techArticleId = router.query.id as string | undefined; diff --git a/pages/techblog/index.page.tsx b/pages/techblog/index.page.tsx index 05e00dcc..8acc7712 100644 --- a/pages/techblog/index.page.tsx +++ b/pages/techblog/index.page.tsx @@ -21,6 +21,7 @@ import { TechSkeletonList, } from '@components/common/skeleton/techBlogSkeleton'; import SearchInput from '@components/common/techSearchInput/searchInput'; +import MetaHead from '@components/meta/MetaHead'; import { INITIAL_TECH_SORT_OPTION, techBlogDropdownOptions } from '@/constants/DropdownOption'; import { ONE_DAY_IN_SECONDS } from '@/constants/TimeConstants'; @@ -61,6 +62,8 @@ export default function Index() { const { companyId, resetCompanyInfo } = useCompanyInfoStore(); const { setToastInvisible } = useToastVisibleStore(); + const { title, description, keyword, url } = META.TECH; + const { techBlogData, isFetchingNextPage, hasNextPage, status, onIntersect } = useInfiniteTechBlogData(sortOption as TechBlogDropdownProps, searchKeyword, companyId); @@ -125,37 +128,40 @@ export default function Index() { }; return ( -
-
-
-

- 기술블로그 🧪 -

- + <> + +
+
+
+

+ 기술블로그 🧪 +

+ +
+ {/* 구독영역 */} + ( + + )} + > + + + {/* 총갯수 & 드롭다운 영역 */} +
+

+ 총 {totalArticleCnt}건 +

+ {isMobile ? : } +
+ {/* 게시글 목록 */} + {getStatusComponent(techBlogData, status)} +
- {/* 구독영역 */} - ( - - )} - > - - - {/* 총갯수 & 드롭다운 영역 */} -
-

- 총 {totalArticleCnt}건 -

- {isMobile ? : } -
- {/* 게시글 목록 */} - {getStatusComponent(techBlogData, status)} -
-
+ ); } @@ -195,7 +201,6 @@ export async function getStaticProps() { return { props: { dehydratedState: dehydrate(queryClient), - meta: META.TECH, }, revalidate: ONE_DAY_IN_SECONDS, // 페이지를 하루(24시간)마다 다시 생성 }; @@ -203,4 +208,4 @@ export async function getStaticProps() { console.error('Error prefetching tech blog data:', error); throw new Error('데이터를 프리패치 하는중 오류가 발생했습니다.'); } -} \ No newline at end of file +}