File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ import { useHistory, useParams } from "react-router-dom";
11
11
import { axiosRes } from "../../api/axiosDefaults" ;
12
12
import { useCurrentUser } from "../../contexts/CurrentUserContext" ;
13
13
14
+ // feedback messages for user CRUD
15
+ import { toast } from "react-toastify" ;
16
+ import "react-toastify/dist/ReactToastify.css" ;
17
+
14
18
import btnStyles from "../../styles/Button.module.css" ;
15
19
import appStyles from "../../App.module.css" ;
16
20
@@ -52,6 +56,15 @@ const UserPasswordForm = () => {
52
56
}
53
57
} ;
54
58
59
+ // feedback messages for user CRUD
60
+ const passwordEditSuccessMsg = ( ) => {
61
+ toast . success ( "You have successfully changed your password 🎉" ) ;
62
+ } ;
63
+
64
+ const passwordEditCancelMsg = ( ) => {
65
+ toast . success ( "You chose not to change your password 👍" ) ;
66
+ } ;
67
+
55
68
return (
56
69
< Row >
57
70
< Col className = "py-2 mx-auto text-center" md = { 6 } >
@@ -89,13 +102,19 @@ const UserPasswordForm = () => {
89
102
) ) }
90
103
< Button
91
104
className = { `${ btnStyles . Button } ${ btnStyles . Blue } ` }
92
- onClick = { ( ) => history . goBack ( ) }
105
+ onClick = { ( ) => {
106
+ history . goBack ( ) ;
107
+ passwordEditCancelMsg ( ) ;
108
+ } }
93
109
>
94
110
cancel
95
111
</ Button >
96
112
< Button
97
113
type = "submit"
98
114
className = { `${ btnStyles . Button } ${ btnStyles . Blue } ` }
115
+ onClick = { ( ) => {
116
+ passwordEditSuccessMsg ( ) ;
117
+ } }
99
118
>
100
119
save
101
120
</ Button >
You can’t perform that action at this time.
0 commit comments