@@ -7,7 +7,7 @@ import css from '@styled-system/css';
77import { Authorization } from 'app/graphql/types' ;
88import { useOvermind } from 'app/overmind' ;
99import { formatDistanceToNow } from 'date-fns' ;
10- import React , { ChangeEvent } from 'react' ;
10+ import React from 'react' ;
1111
1212import { Mail , WarningIcon } from './icons' ;
1313import { PermissionSelect } from './PermissionSelect' ;
@@ -21,9 +21,7 @@ interface ICollaboratorItemProps {
2121 subtext ?: string ;
2222 avatarUrl ?: string ;
2323 avatarComponent ?: JSX . Element | null ;
24- onChange ?: (
25- event : ChangeEvent < HTMLSelectElement > & ChangeEvent < HTMLInputElement >
26- ) => void ;
24+ onChange ?: ( value : string ) => void ;
2725 fillAvatar ?: boolean ;
2826 permissionText ?: string ;
2927 readOnly ?: boolean ;
@@ -135,8 +133,8 @@ export const Collaborator = ({
135133} : ICollaboratorProps ) => {
136134 const { actions, state } = useOvermind ( ) ;
137135
138- const updateAuthorization = ( event : React . ChangeEvent < HTMLSelectElement > ) => {
139- if ( event . target . value === 'remove' ) {
136+ const updateAuthorization = ( value : string ) => {
137+ if ( value === 'remove' ) {
140138 actions . editor . removeCollaborator ( {
141139 username,
142140 sandboxId : state . editor . currentSandbox . id ,
@@ -145,7 +143,7 @@ export const Collaborator = ({
145143 actions . editor . changeCollaboratorAuthorization ( {
146144 username,
147145 sandboxId : state . editor . currentSandbox . id ,
148- authorization : event . target . value as Authorization ,
146+ authorization : value as Authorization ,
149147 } ) ;
150148 }
151149 } ;
@@ -181,9 +179,9 @@ interface IInvitationProps {
181179export const Invitation = ( { id, email, authorization } : IInvitationProps ) => {
182180 const { actions, state } = useOvermind ( ) ;
183181
184- const updateAuthorization = ( event : React . ChangeEvent < HTMLSelectElement > ) => {
182+ const updateAuthorization = ( value : string ) => {
185183 // We have to do something here
186- if ( event . target . value === 'remove' ) {
184+ if ( value === 'remove' ) {
187185 actions . editor . revokeSandboxInvitation ( {
188186 invitationId : id ,
189187 sandboxId : state . editor . currentSandbox . id ,
@@ -192,7 +190,7 @@ export const Invitation = ({ id, email, authorization }: IInvitationProps) => {
192190 actions . editor . changeInvitationAuthorization ( {
193191 invitationId : id ,
194192 sandboxId : state . editor . currentSandbox . id ,
195- authorization : event . target . value as Authorization ,
193+ authorization : value as Authorization ,
196194 } ) ;
197195 }
198196 } ;
0 commit comments