fix(client): don't show trash icon if no comment

This commit is contained in:
zkldi
2022-07-25 22:21:24 +01:00
parent 9b0e336a12
commit 2e5ceb02f7
@@ -183,22 +183,24 @@ function CommentModal({
</div>
</Form.Group>
<QuickTooltip tooltipContent="Remove your comment on this score.">
<Button
variant="outline-danger"
onClick={() =>
ModifyScore(scoreID, { comment: null }).then((r) => {
if (r) {
setComment(null);
score.comment = null;
setShow(false);
}
})
}
>
<Icon noPad type="trash" />
</Button>
</QuickTooltip>
{comment !== null && (
<QuickTooltip tooltipContent="Remove your comment on this score.">
<Button
variant="outline-danger"
onClick={() =>
ModifyScore(scoreID, { comment: null }).then((r) => {
if (r) {
setComment(null);
score.comment = null;
setShow(false);
}
})
}
>
<Icon noPad type="trash" />
</Button>
</QuickTooltip>
)}
</Form>
</Modal.Body>
</Modal>