From e1bbc3f1ce20d73528cdbf26131ecbf2812ad0dd Mon Sep 17 00:00:00 2001 From: David S Price Date: Tue, 30 Mar 2021 22:13:06 -0700 Subject: [PATCH] swap Flash for Toast --- web/src/pages/ContactPage/ContactPage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/src/pages/ContactPage/ContactPage.js b/web/src/pages/ContactPage/ContactPage.js index 5e4ae43..8271a0a 100644 --- a/web/src/pages/ContactPage/ContactPage.js +++ b/web/src/pages/ContactPage/ContactPage.js @@ -7,7 +7,8 @@ import { Label, FormError, } from '@redwoodjs/forms' -import { Flash, useFlash, useMutation } from '@redwoodjs/web' +import { useMutation } from '@redwoodjs/web' +import { toast, Toaster } from '@redwoodjs/web/toast' import { useForm } from 'react-hook-form' const CREATE_CONTACT = gql` @@ -20,13 +21,10 @@ const CREATE_CONTACT = gql` const ContactPage = () => { const formMethods = useForm() - const { addMessage } = useFlash() const [create, { loading, error }] = useMutation(CREATE_CONTACT, { onCompleted: () => { - addMessage('Thank you for your submission!', { - style: { backgroundColor: 'green', color: 'white', padding: '1rem' }, - }) + toast.success('Thank you for your submission!') formMethods.reset() }, }) @@ -38,7 +36,7 @@ const ContactPage = () => { return ( <> - +