diff options
-rw-r--r-- | src/components/ReviewCard/ReviewCard.tsx | 16 | ||||
-rw-r--r-- | src/pages/HomePage/ReviewForm.tsx | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/components/ReviewCard/ReviewCard.tsx b/src/components/ReviewCard/ReviewCard.tsx index 97581fc..2016a5e 100644 --- a/src/components/ReviewCard/ReviewCard.tsx +++ b/src/components/ReviewCard/ReviewCard.tsx @@ -30,12 +30,16 @@ const ReviewCard: React.FC<PropTypes> = ({ feedback }) => { user={feedback.author} info={<Rating value={feedback.score} readOnly size="small" />} /> - <Divider /> - <CardContent> - <Typography> - {feedback.contents} - </Typography> - </CardContent> + {feedback.contents && ( + <> + <Divider /> + <CardContent> + <Typography> + {feedback.contents} + </Typography> + </CardContent> + </> + )} </Card> ); }; diff --git a/src/pages/HomePage/ReviewForm.tsx b/src/pages/HomePage/ReviewForm.tsx index 7ad0880..248e36e 100644 --- a/src/pages/HomePage/ReviewForm.tsx +++ b/src/pages/HomePage/ReviewForm.tsx @@ -27,7 +27,7 @@ const ReviewForm: React.FC = () => { const { enqueueSnackbar } = useSnackbar(); const handleSubmit = (): void => { - if (contents && score) { + if (score) { post('/feedback', { contents, score, version }).then(() => { enqueueSnackbar('Your feedback has been submitted!', { variant: 'success' |