Skip to content

Commit

Permalink
feat(article): ArticlePageContainer 에서 실제 아티클 목록 데이터를 받아 ArticleComme…
Browse files Browse the repository at this point in the history
…nts 에 주입하도록 함
  • Loading branch information
innocarpe committed Sep 20, 2023
1 parent 7c34a00 commit 862dcee
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ArticleComments from './ArticleComments';
import ArticleContents from './ArticleContents';
import ArticleHeader from './ArticleHeader';
import useArticleDetailQuery from '@quries/useArticleDetailQuery';
import useArticleCommentsQuery from '@quries/useArticleCommentsQuery';

interface ArticlePageContainerProps {
articleSlug: string;
Expand All @@ -12,6 +13,7 @@ interface ArticlePageContainerProps {
const ArticlePageContainer = (props: ArticlePageContainerProps) => {
const { articleSlug } = props;
const { articleDetail } = useArticleDetailQuery(articleSlug);
const { articleComments } = useArticleCommentsQuery(articleSlug);

if (!articleDetail) {
return null;
Expand All @@ -38,7 +40,7 @@ const ArticlePageContainer = (props: ArticlePageContainerProps) => {
favorited={articleDetail.article.favorited}
favoritesCount={articleDetail.article.favoritesCount}
/>
<ArticleComments />
<ArticleComments comments={articleComments?.comments || []} />
</Container>
</div>
);
Expand Down

0 comments on commit 862dcee

Please sign in to comment.