@@ -9,6 +9,7 @@ import track from '@codesandbox/common/lib/utils/analytics';
99
1010import { useOvermind } from 'app/overmind' ;
1111import { INVITE_TO_TEAM } from '../../../../queries' ;
12+ import { IAddTeamMemberProps , IMutationVariables } from './types' ;
1213
1314const ErrorMessage = styled . div `
1415 color: ${ props => props . theme . red } ;
@@ -17,12 +18,12 @@ const ErrorMessage = styled.div`
1718 margin-bottom: 0.5rem;
1819` ;
1920
20- export const AddTeamMember = ( { teamId } ) => {
21+ export const AddTeamMember : React . FC < IAddTeamMemberProps > = ( { teamId } ) => {
2122 const { actions } = useOvermind ( ) ;
2223 const [ mutate , { loading, error } ] = useMutation ( INVITE_TO_TEAM ) ;
23- let input = null ;
24+ let input : HTMLInputElement = null ;
2425
25- const submit = e => {
26+ const submit : React . FormEventHandler = e => {
2627 e . preventDefault ( ) ;
2728 e . stopPropagation ( ) ;
2829
@@ -34,7 +35,7 @@ export const AddTeamMember = ({ teamId }) => {
3435
3536 // We don't enable email for now for privacy reasons
3637
37- const variables = { teamId } ;
38+ const variables : IMutationVariables = { teamId } ;
3839
3940 const { value } = input ;
4041 if ( isEmail ) {
@@ -47,8 +48,8 @@ export const AddTeamMember = ({ teamId }) => {
4748 variables,
4849 } ) . then ( ( ) => {
4950 actions . notificationAdded ( {
50- message : `${ value } has been invited!` ,
51- type : 'success' ,
51+ title : `${ value } has been invited!` ,
52+ notificationType : 'success' ,
5253 } ) ;
5354 } ) ;
5455
0 commit comments