Skip to content

Commit e9f8619

Browse files
authored
Place permission guards in Language Overview (#1777)
1 parent a906909 commit e9f8619

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/posts/PostList.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const PostList = ({
3232
}: PostListProps) => {
3333
const { classes } = useStyles();
3434
const [createPostState, createPost] = useDialog();
35+
const canCreate = rest.data?.canCreate;
3536

3637
return (
3738
<div>
@@ -41,7 +42,13 @@ export const PostList = ({
4142
</Grid>
4243
<Grid item>
4344
<Tooltip title="Add Post">
44-
<Fab color="error" onClick={createPost}>
45+
<Fab
46+
sx={{
47+
visibility: canCreate ? 'visible' : 'hidden',
48+
}}
49+
color="error"
50+
onClick={createPost}
51+
>
4552
<Add />
4653
</Fab>
4754
</Tooltip>

0 commit comments

Comments
 (0)