mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
Display real number of comment
This commit is contained in:
parent
4c7761461b
commit
688cc33ccc
@ -9,5 +9,8 @@ fragment BugRow on Bug {
|
|||||||
labels {
|
labels {
|
||||||
...Label
|
...Label
|
||||||
}
|
}
|
||||||
|
comments {
|
||||||
|
totalCount
|
||||||
|
}
|
||||||
...authored
|
...authored
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,10 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
commentCount: {
|
||||||
|
fontSize: '1rem',
|
||||||
|
marginLeft: theme.spacing(0.5),
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -84,6 +88,8 @@ type Props = {
|
|||||||
|
|
||||||
function BugRow({ bug }: Props) {
|
function BugRow({ bug }: Props) {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
// Subtract 1 from totalCount as 1 comment is the bug description
|
||||||
|
const commentCount = bug.comments.totalCount - 1;
|
||||||
return (
|
return (
|
||||||
<TableRow hover>
|
<TableRow hover>
|
||||||
<TableCell className={classes.cell}>
|
<TableCell className={classes.cell}>
|
||||||
@ -109,12 +115,16 @@ function BugRow({ bug }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
|
{commentCount > 0 && (
|
||||||
<Grid container wrap="nowrap">
|
<Grid container wrap="nowrap">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<CommentOutlinedIcon aria-label="Comment count" />
|
<CommentOutlinedIcon aria-label="Comment count" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>Count</Grid>
|
<Grid item>
|
||||||
|
<span className={classes.commentCount}>{commentCount}</span>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user