mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added post
page
This commit is contained in:
parent
91ae6650e7
commit
1f7e0345fb
33
packages/app/src/pages/post/[post_id].jsx
Normal file
33
packages/app/src/pages/post/[post_id].jsx
Normal file
@ -0,0 +1,33 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
import { PostCard } from "components"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default (props) => {
|
||||
const [data, setData] = React.useState(null)
|
||||
const post_id = props.match.params.post_id
|
||||
|
||||
const loadData = async () => {
|
||||
setData(null)
|
||||
|
||||
const data = await window.app.api.request("main", "get", `post`, undefined, {
|
||||
post_id
|
||||
})
|
||||
|
||||
setData(data)
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
loadData()
|
||||
}, [])
|
||||
|
||||
if (!data) {
|
||||
return <antd.Skeleton active />
|
||||
}
|
||||
|
||||
return <div className="fullPost">
|
||||
<PostCard data={data} fullmode />
|
||||
</div>
|
||||
}
|
3
packages/app/src/pages/post/index.less
Normal file
3
packages/app/src/pages/post/index.less
Normal file
@ -0,0 +1,3 @@
|
||||
.fullPost {
|
||||
display: flex;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user