+ >
);
}
-
-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
+}