diff --git a/src/components/learning/SubscriptionBanner.tsx b/src/components/learning/SubscriptionBanner.tsx
index 162fbaf..1f85aaa 100644
--- a/src/components/learning/SubscriptionBanner.tsx
+++ b/src/components/learning/SubscriptionBanner.tsx
@@ -1,6 +1,9 @@
+import { useRouter } from 'next/navigation';
import React from 'react';
const SubscriptionBanner = () => {
+ const router = useRouter();
+
return (
@@ -10,7 +13,8 @@ const SubscriptionBanner = () => {
-
diff --git a/src/components/learning/article/RelatedArticles.tsx b/src/components/learning/article/RelatedArticles.tsx
index 4945e5d..686080b 100644
--- a/src/components/learning/article/RelatedArticles.tsx
+++ b/src/components/learning/article/RelatedArticles.tsx
@@ -3,12 +3,14 @@ import { RelatedArticle } from "@/types/learning";
import Image from "next/image";
import { getRelatedArticles } from "@/factory/Article/GetArticle";
import { getValidImageSrc } from "@/utils/checkImageProperty";
+import { useRouter } from "next/navigation";
interface RelatedArticlesProps {
articleId: number;
}
const RelatedArticles = ({ articleId }: RelatedArticlesProps) => {
+ const router = useRouter();
const [relatedArticles, setRelatedArticles] = useState
("");
useEffect(() => {
@@ -25,6 +27,10 @@ const RelatedArticles = ({ articleId }: RelatedArticlesProps) => {
fetchData();
}, [articleId]);
+ const handleContentClick = (item: any) => {
+ router.push(`/learning/detail/${item.article.articleId}`);
+ };
+
// 데이터가 없을 때 처리
if (typeof relatedArticles === "string") {
return (
@@ -44,7 +50,8 @@ const RelatedArticles = ({ articleId }: RelatedArticlesProps) => {
{relatedArticles.map((item) => (
-
+
handleContentClick(item)}>