mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-18 06:54:15 +00:00
Format
This commit is contained in:
parent
a62ab7c919
commit
eb5c28d61e
@ -12,43 +12,44 @@ import useCenteredContainer from "@hooks/useCenteredContainer"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
const PostPage = (props) => {
|
||||
const post_id = props.params.post_id
|
||||
const PostPage = ({ params }) => {
|
||||
const post_id = params.post_id
|
||||
|
||||
useCenteredContainer(true)
|
||||
|
||||
const [loading, result, error, repeat] = app.cores.api.useRequest(PostService.getPost, {
|
||||
const [loading, result, error, repeat] = app.cores.api.useRequest(
|
||||
PostService.getPost,
|
||||
{
|
||||
post_id,
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
if (error) {
|
||||
return <antd.Result
|
||||
return (
|
||||
<antd.Result
|
||||
status="warning"
|
||||
title="Failed to retrieve post"
|
||||
subTitle={error.message}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <antd.Skeleton active />
|
||||
}
|
||||
|
||||
return <div className="post-page">
|
||||
return (
|
||||
<div className="post-page">
|
||||
<div className="post-page-original">
|
||||
<h1>
|
||||
<Icons.MdTextSnippet />
|
||||
Post
|
||||
</h1>
|
||||
|
||||
<PostCard
|
||||
data={result}
|
||||
disableHasReplies
|
||||
/>
|
||||
<PostCard data={result} disableHasReplies />
|
||||
</div>
|
||||
|
||||
{
|
||||
!!result.hasReplies && <div className="post-page-replies">
|
||||
<h1><Icons.FiRepeat />Replies</h1>
|
||||
{!!result.hasReplies && (
|
||||
<div className="post-page-replies">
|
||||
<h1>
|
||||
<Icons.FiRepeat />
|
||||
Replies
|
||||
</h1>
|
||||
|
||||
<PostsList
|
||||
disableReplyTag
|
||||
@ -58,8 +59,9 @@ const PostPage = (props) => {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PostPage
|
Loading…
x
Reference in New Issue
Block a user