diff --git a/frontend/src/pages/EditMe.tsx b/frontend/src/pages/EditMe.tsx index d418b5e..75be106 100644 --- a/frontend/src/pages/EditMe.tsx +++ b/frontend/src/pages/EditMe.tsx @@ -20,10 +20,6 @@ import Loading from "../lib/Loading"; import Card from "../lib/Card"; import TextInput from "../lib/TextInput"; -interface FieldWithID extends Field { - id: number; -} - interface EditField { id: number; name: string; @@ -113,11 +109,26 @@ export default function EditMe() { field.name = e.target.value; setFields([...fields]); }} - onChangeFavourite={null} - onChangeOkay={null} - onChangeJokingly={null} - onChangeFriends={null} - onChangeAvoid={null} + onChangeFavourite={(e, entry: string) => { + field.pronouns[entry] = PronounChoice.favourite; + setFields([...fields]); + }} + onChangeOkay={(e, entry: string) => { + field.pronouns[entry] = PronounChoice.okay; + setFields([...fields]); + }} + onChangeJokingly={(e, entry: string) => { + field.pronouns[entry] = PronounChoice.jokingly; + setFields([...fields]); + }} + onChangeFriends={(e, entry: string) => { + field.pronouns[entry] = PronounChoice.friendsOnly; + setFields([...fields]); + }} + onChangeAvoid={(e, entry: string) => { + field.pronouns[entry] = PronounChoice.avoid; + setFields([...fields]); + }} onClickDelete={(_) => { const newFields = [...fields]; newFields.splice(i, 1); @@ -133,11 +144,14 @@ export default function EditMe() { type EditableCardProps = { field: EditField; onChangeName: React.ChangeEventHandler; - onChangeFavourite: any; - onChangeOkay: any; - onChangeJokingly: any; - onChangeFriends: any; - onChangeAvoid: any; + onChangeFavourite( + e: React.MouseEvent, + entry: string + ): void; + onChangeOkay(e: React.MouseEvent, entry: string): void; + onChangeJokingly(e: React.MouseEvent, entry: string): void; + onChangeFriends(e: React.MouseEvent, entry: string): void; + onChangeAvoid(e: React.MouseEvent, entry: string): void; onClickDelete: React.MouseEventHandler; }; @@ -167,6 +181,7 @@ function EditableCard(props: EditableCardProps) {