From 3ae2efdad0c492af049f7377629b562831be8c6a Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Sun, 3 Oct 2021 14:55:38 +0200 Subject: [PATCH] Remove type-errors --- packages/app/components/child.component.tsx | 2 ++ packages/app/components/classmates.component.tsx | 4 ++-- packages/app/components/contactMenu.component.tsx | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/app/components/child.component.tsx b/packages/app/components/child.component.tsx index 3b87597b..b2c3fb2e 100644 --- a/packages/app/components/child.component.tsx +++ b/packages/app/components/child.component.tsx @@ -125,6 +125,8 @@ const getRouteTitleFromName = (routeName: string) => { return translate('navigation.menu') case 'Classmates': return translate('navigation.classmates') + default: + return routeName } } diff --git a/packages/app/components/classmates.component.tsx b/packages/app/components/classmates.component.tsx index 681b5517..256bf750 100644 --- a/packages/app/components/classmates.component.tsx +++ b/packages/app/components/classmates.component.tsx @@ -26,7 +26,7 @@ export const Classmates = () => { const renderItemIcon = (props: IconProps) => ( ) - const [selected, setSelected] = React.useState() + const [selected, setSelected] = React.useState() const renderItem = ({ item, index }: ListRenderItemInfo) => ( { setSelected(classMate)} /> )} /> diff --git a/packages/app/components/contactMenu.component.tsx b/packages/app/components/contactMenu.component.tsx index 059aa1a7..a13591cf 100644 --- a/packages/app/components/contactMenu.component.tsx +++ b/packages/app/components/contactMenu.component.tsx @@ -21,7 +21,7 @@ import { translate } from '../utils/translation' interface ContactMenuProps { contact: Classmate selected: boolean - setSelected: (value?: number | null) => void + setSelected: (value?: Classmate | undefined) => void } export const ContactMenu = ({ @@ -54,7 +54,7 @@ export const ContactMenu = ({ const handleBackdropPress = () => { setVisible(false) - setSelected(null) + setSelected(undefined) } const shouldDisplay = (option?: string) => (option ? 'flex' : 'none')