-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
6,036 additions
and
26,206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,46 @@ | ||
import React from "react"; | ||
"use client"; | ||
import { Fragment } from "react"; | ||
|
||
import ModalTriggerButton from "@/components/common/button/ModalTriggerButton"; | ||
import CommentCard from "@/components/common/card/comment/CommentCard"; | ||
import MainContainer from "@/components/common/container/MainContainer"; | ||
import MoreModal from "@/components/modalTemplate/moreModal/MoreModal"; | ||
import useCheckAdmin from "@/hooks/queries/admin/useCheckAdmin"; | ||
import { useGetReportedComments } from "@/hooks/queries/admin/useGetReportedComments"; | ||
import { Comment } from "@/types/post"; | ||
import { useInView } from "framer-motion"; | ||
|
||
export default function AdminCommentPage() { | ||
return <div>page</div>; | ||
const { isError, isFetching: isCheckFetching, isSuccess } = useCheckAdmin(); | ||
const { data, fetchNextPage, isFetchingNextPage, isPending } = useGetReportedComments(); | ||
|
||
if (isCheckFetching) return <MainContainer>loading...</MainContainer>; | ||
if (isError) return <MainContainer>권한이 없습니다.</MainContainer>; | ||
if (isSuccess) { | ||
return ( | ||
<MainContainer> | ||
<form className="z-20 hidden flex-shrink-0 flex-col overflow-hidden md:flex"> | ||
<div className="z-20 h-[610px] overflow-y-auto overflow-x-hidden pl-5 font-poorStory scrollbar-hide "> | ||
{data?.pages.map(({ pages, pageParams }) => ( | ||
<Fragment key={pageParams || 0}> | ||
{pages.map((comment: Comment) => ( | ||
<CommentCard | ||
key={comment._id} | ||
commentProfileImage={comment.user.profileImage} | ||
commentUserNickname={comment.user.nickname} | ||
commentContent={comment.content} | ||
commentCreatedAt={comment.createdAt} | ||
> | ||
<ModalTriggerButton loginRequired content="more"> | ||
<MoreModal type="comment" targetId={comment._id} targetUser={comment.user} /> | ||
</ModalTriggerButton> | ||
</CommentCard> | ||
))} | ||
</Fragment> | ||
))} | ||
</div> | ||
</form> | ||
</MainContainer> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.