Skip to content

Commit b041151

Browse files
committed
wrap create post in Language Overview with permission guard
1 parent 4d88872 commit b041151

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/components/posts/PostList.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ export const PostList = ({
4040
<Grid item>
4141
<Typography variant="h3">Posts</Typography>
4242
</Grid>
43-
{canCreate && (
44-
<Grid item>
45-
<Tooltip title="Add Post">
46-
<Fab color="error" onClick={createPost}>
47-
<Add />
48-
</Fab>
49-
</Tooltip>
50-
</Grid>
51-
)}
43+
<Grid item>
44+
<Tooltip title="Add Post">
45+
<Fab
46+
sx={{
47+
visibility: canCreate ? 'visible' : 'hidden',
48+
}}
49+
color="error"
50+
onClick={createPost}
51+
>
52+
<Add />
53+
</Fab>
54+
</Tooltip>
55+
</Grid>
5256
</Grid>
5357
<List
5458
{...rest}

0 commit comments

Comments
 (0)