Skip to content

Commit

Permalink
Use correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyAppeldoorn committed Aug 17, 2023
1 parent eccb02d commit 0b4e1e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/feed/components/UserDropdown/UserDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component, PropsWithRef, SyntheticEvent } from "react";
import { Dropdown } from "semantic-ui-react";
import { Dropdown, DropdownProps } from "semantic-ui-react";
import { Query } from "@apollo/client/react/components";

import client from "../../../../client";
Expand Down Expand Up @@ -47,7 +47,7 @@ class DropdownRemote extends Component<DropDownProps, DropDownState> {
this.setState(this.initialState);
}

handleAddition(e: React.KeyboardEvent<HTMLElement>, { value }: any) {
handleAddition(_e: React.SyntheticEvent<HTMLElement, Event>, data: DropdownProps) {
const oldState = client.readQuery({
query: GET_USERS,
variables: {
Expand All @@ -56,7 +56,7 @@ class DropdownRemote extends Component<DropDownProps, DropDownState> {
});

const existing = oldState.teamById.users.filter(
(u: User) => u.name === value
(u: User) => u.name === data.value
);
if (existing.length > 0) {
return;
Expand All @@ -82,7 +82,7 @@ class DropdownRemote extends Component<DropDownProps, DropDownState> {
...oldState.teamById.users,
{
id,
name: value,
name: data.value,
virtualUser: true,
__typename: "User",
},
Expand Down Expand Up @@ -141,7 +141,7 @@ class DropdownRemote extends Component<DropDownProps, DropDownState> {
disabled={loading}
loading={loading}
error={!!error || this.props.error}
onAddItem={() => this.handleAddition}
onAddItem={this.handleAddition}
onChange={this.handleChange}
/>
);
Expand Down

0 comments on commit 0b4e1e9

Please sign in to comment.