diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-10-09 03:35:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 03:35:31 +0300 |
commit | fcaddcd6ad8607d05279acdb87675de6180ac1cb (patch) | |
tree | 818dc66ce2e45b5f29728b1e6654935d616ad3d5 /src/containers/Home/ReviewForm.tsx | |
parent | a5d0f3edcd5478c81262524cbfef8273a065df36 (diff) | |
parent | 5b81a690ed3c407aeb934b92fdad4a37c7e01a4b (diff) | |
download | which-ui-fcaddcd6ad8607d05279acdb87675de6180ac1cb.tar.gz |
Merge pull request #104 from which-ecosystem/feat/patch-notes
Display patch notes on home screen
Diffstat (limited to 'src/containers/Home/ReviewForm.tsx')
-rw-r--r-- | src/containers/Home/ReviewForm.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/containers/Home/ReviewForm.tsx b/src/containers/Home/ReviewForm.tsx index b626ce2..56f4f8e 100644 --- a/src/containers/Home/ReviewForm.tsx +++ b/src/containers/Home/ReviewForm.tsx @@ -1,13 +1,16 @@ import React, { useState } from 'react'; -import { useHistory } from 'react-router-dom'; import { makeStyles } from '@material-ui/core/styles'; import { TextField, Button } from '@material-ui/core'; import { Rating } from '@material-ui/lab'; import { useSnackbar } from 'notistack'; +import { useFeedback } from '../../hooks/APIClient'; import { post } from '../../requests'; -const version = 'v1.0.0'; + +interface PropTypes { + version: string; +} const useStyles = makeStyles(theme => ({ root: { @@ -19,11 +22,11 @@ const useStyles = makeStyles(theme => ({ } })); -const ReviewForm: React.FC = () => { +const ReviewForm: React.FC<PropTypes> = ({ version }) => { const [contents, setContents] = useState<string>(''); const [score, setScore] = useState<number>(0); + const { mutate: updateFeedbacks } = useFeedback(); const classes = useStyles(); - const history = useHistory(); const { enqueueSnackbar } = useSnackbar(); const handleSubmit = (): void => { @@ -32,7 +35,7 @@ const ReviewForm: React.FC = () => { enqueueSnackbar('Your feedback has been submitted!', { variant: 'success' }); - history.push('/feed'); + updateFeedbacks(); }); } }; |