added post page

This commit is contained in:
srgooglo 2022-09-07 11:15:54 +02:00
parent 91ae6650e7
commit 1f7e0345fb
2 changed files with 36 additions and 0 deletions

View 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>
}

View File

@ -0,0 +1,3 @@
.fullPost {
display: flex;
}