@@ -9,6 +9,7 @@ import track from '@codesandbox/common/lib/utils/analytics';
9
9
10
10
import { useOvermind } from 'app/overmind' ;
11
11
import { INVITE_TO_TEAM } from '../../../../queries' ;
12
+ import { IAddTeamMemberProps , IMutationVariables } from './types' ;
12
13
13
14
const ErrorMessage = styled . div `
14
15
color: ${ props => props . theme . red } ;
@@ -17,12 +18,12 @@ const ErrorMessage = styled.div`
17
18
margin-bottom: 0.5rem;
18
19
` ;
19
20
20
- export const AddTeamMember = ( { teamId } ) => {
21
+ export const AddTeamMember : React . FC < IAddTeamMemberProps > = ( { teamId } ) => {
21
22
const { actions } = useOvermind ( ) ;
22
23
const [ mutate , { loading, error } ] = useMutation ( INVITE_TO_TEAM ) ;
23
- let input = null ;
24
+ let input : HTMLInputElement = null ;
24
25
25
- const submit = e => {
26
+ const submit : React . FormEventHandler = e => {
26
27
e . preventDefault ( ) ;
27
28
e . stopPropagation ( ) ;
28
29
@@ -34,7 +35,7 @@ export const AddTeamMember = ({ teamId }) => {
34
35
35
36
// We don't enable email for now for privacy reasons
36
37
37
- const variables = { teamId } ;
38
+ const variables : IMutationVariables = { teamId } ;
38
39
39
40
const { value } = input ;
40
41
if ( isEmail ) {
@@ -47,8 +48,8 @@ export const AddTeamMember = ({ teamId }) => {
47
48
variables,
48
49
} ) . then ( ( ) => {
49
50
actions . notificationAdded ( {
50
- message : `${ value } has been invited!` ,
51
- type : 'success' ,
51
+ title : `${ value } has been invited!` ,
52
+ notificationType : 'success' ,
52
53
} ) ;
53
54
} ) ;
54
55
0 commit comments