diff options
author | ilyayudovin <46264063+ilyayudovin@users.noreply.github.com> | 2020-07-01 18:43:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 18:43:54 +0300 |
commit | 0b234a7ae255990d71f847a5519482ccb0d83fcb (patch) | |
tree | 7cfd6ff4b8bd154074b9a42aaf4efe5b9cd471e6 /src/pages/FeedPage | |
parent | fc552cbf3ffcba6d2cc7003936f4b55378541525 (diff) | |
parent | f9999d6da7752a55ad01f85dce34086c1acbff5a (diff) | |
download | which-ui-0b234a7ae255990d71f847a5519482ccb0d83fcb.tar.gz |
Merge pull request #55 from which-ecosystem/snackbar
snackbar
Diffstat (limited to 'src/pages/FeedPage')
-rw-r--r-- | src/pages/FeedPage/PollSubmission.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pages/FeedPage/PollSubmission.tsx b/src/pages/FeedPage/PollSubmission.tsx index 18f029c..b067914 100644 --- a/src/pages/FeedPage/PollSubmission.tsx +++ b/src/pages/FeedPage/PollSubmission.tsx @@ -8,6 +8,7 @@ import { Divider } from '@material-ui/core'; import { Poll, Which } from 'which-types'; +import { useSnackbar } from 'notistack'; import PollSubmissionImage from './PollSubmissionImage'; import UserStrip from '../../components/UserStrip/UserStrip'; import { post } from '../../requests'; @@ -34,6 +35,7 @@ const PollSubmission: React.FC<PropTypes> = ({ addPoll }) => { const classes = useStyles(); const [expanded, setExpanded] = useState(false); const [contents, setContents] = useState<Contents>(emptyContents); + const { enqueueSnackbar } = useSnackbar(); const { user } = useAuth(); const readyToSubmit = contents.left.url && contents.right.url; @@ -50,6 +52,9 @@ const PollSubmission: React.FC<PropTypes> = ({ addPoll }) => { if (expanded && readyToSubmit) { post('/polls/', { contents }).then(response => { addPoll(response.data); + enqueueSnackbar('Your poll has been successfully created!', { + variant: 'success' + }); }); setContents({ ...emptyContents }); } |