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