mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
optimize for mobile
This commit is contained in:
parent
b25e5e4d8d
commit
82710e4ee7
39
packages/app/src/pages/post/[post_id].mobile.jsx
Normal file
39
packages/app/src/pages/post/[post_id].mobile.jsx
Normal file
@ -0,0 +1,39 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
import Post from "models/post"
|
||||
import { PostCard, CommentsCard } from "components"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default (props) => {
|
||||
const post_id = props.match.params.post_id
|
||||
|
||||
const [data, setData] = React.useState(null)
|
||||
|
||||
const loadData = async () => {
|
||||
setData(null)
|
||||
|
||||
const data = await Post.getPost({ post_id }).catch(() => {
|
||||
antd.message.error("Failed to get post")
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
if (data) {
|
||||
setData(data)
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
loadData()
|
||||
}, [])
|
||||
|
||||
if (!data) {
|
||||
return <antd.Skeleton active />
|
||||
}
|
||||
|
||||
return <div className="postPage">
|
||||
<PostCard data={data} fullmode />
|
||||
</div>
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user