Show "Add Post" button only to users

This commit is contained in:
Pico2x 2022-09-23 15:08:57 -04:00
parent fd38a92717
commit 7c94672d12

View File

@ -448,6 +448,7 @@ function GroupLeaderboard(props: {
function GroupPosts(props: { posts: Post[]; group: Group }) { function GroupPosts(props: { posts: Post[]; group: Group }) {
const { posts, group } = props const { posts, group } = props
const [showCreatePost, setShowCreatePost] = useState(false) const [showCreatePost, setShowCreatePost] = useState(false)
const user = useUser()
const createPost = <CreatePost group={group} /> const createPost = <CreatePost group={group} />
@ -458,12 +459,14 @@ function GroupPosts(props: { posts: Post[]; group: Group }) {
<Title text={'Posts'} className="!mt-0" /> <Title text={'Posts'} className="!mt-0" />
</Col> </Col>
<Col> <Col>
{user && (
<Button <Button
className="btn-md" className="btn-md"
onClick={() => setShowCreatePost(!showCreatePost)} onClick={() => setShowCreatePost(!showCreatePost)}
> >
Add a Post Add a Post
</Button> </Button>
)}
</Col> </Col>
</Row> </Row>