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,54 +12,56 @@ import useCenteredContainer from "@hooks/useCenteredContainer"
|
|||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
const PostPage = (props) => {
|
const PostPage = ({ params }) => {
|
||||||
const post_id = props.params.post_id
|
const post_id = params.post_id
|
||||||
|
|
||||||
useCenteredContainer(true)
|
useCenteredContainer(true)
|
||||||
|
|
||||||
const [loading, result, error, repeat] = app.cores.api.useRequest(PostService.getPost, {
|
const [loading, result, error, repeat] = app.cores.api.useRequest(
|
||||||
post_id,
|
PostService.getPost,
|
||||||
})
|
{
|
||||||
|
post_id,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return <antd.Result
|
return (
|
||||||
status="warning"
|
<antd.Result
|
||||||
title="Failed to retrieve post"
|
status="warning"
|
||||||
subTitle={error.message}
|
title="Failed to retrieve post"
|
||||||
/>
|
subTitle={error.message}
|
||||||
}
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <antd.Skeleton active />
|
return <antd.Skeleton active />
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className="post-page">
|
return (
|
||||||
<div className="post-page-original">
|
<div className="post-page">
|
||||||
<h1>
|
<div className="post-page-original">
|
||||||
<Icons.MdTextSnippet />
|
<PostCard data={result} disableHasReplies />
|
||||||
Post
|
</div>
|
||||||
</h1>
|
|
||||||
|
|
||||||
<PostCard
|
{!!result.hasReplies && (
|
||||||
data={result}
|
<div className="post-page-replies">
|
||||||
disableHasReplies
|
<h1>
|
||||||
/>
|
<Icons.FiRepeat />
|
||||||
</div>
|
Replies
|
||||||
|
</h1>
|
||||||
|
|
||||||
{
|
<PostsList
|
||||||
!!result.hasReplies && <div className="post-page-replies">
|
disableReplyTag
|
||||||
<h1><Icons.FiRepeat />Replies</h1>
|
loadFromModel={PostService.replies}
|
||||||
|
loadFromModelProps={{
|
||||||
<PostsList
|
post_id,
|
||||||
disableReplyTag
|
}}
|
||||||
loadFromModel={PostService.replies}
|
/>
|
||||||
loadFromModelProps={{
|
</div>
|
||||||
post_id,
|
)}
|
||||||
}}
|
</div>
|
||||||
/>
|
)
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PostPage
|
export default PostPage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user