From ee852df873c4f109646b680c71e5e0cb94fd5678 Mon Sep 17 00:00:00 2001 From: Hezekiel Tamire Date: Sun, 24 Mar 2024 16:41:13 +0300 Subject: [PATCH] fix ts errors --- src/components/EmojiPicker/EmojiPicker.tsx | 2 +- src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx | 7 ++++++- .../EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.tsx | 4 ++-- src/components/Form/types.ts | 4 +++- src/pages/home/report/ReportActionItem.tsx | 2 +- src/pages/settings/Profile/CustomStatus/StatusPage.tsx | 4 +++- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/EmojiPicker/EmojiPicker.tsx b/src/components/EmojiPicker/EmojiPicker.tsx index d5f417bc2e05..8c7b4df3264f 100644 --- a/src/components/EmojiPicker/EmojiPicker.tsx +++ b/src/components/EmojiPicker/EmojiPicker.tsx @@ -9,8 +9,8 @@ import withViewportOffsetTop from '@components/withViewportOffsetTop'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; -import * as Browser from '@libs/Browser'; import type {AnchorOrigin, EmojiPickerRef, EmojiPopoverAnchor, OnEmojiSelected, OnModalHideValue, OnWillShowPicker} from '@libs/actions/EmojiPickerAction'; +import * as Browser from '@libs/Browser'; import calculateAnchorPosition from '@libs/calculateAnchorPosition'; import CONST from '@src/CONST'; import EmojiPickerMenu from './EmojiPickerMenu'; diff --git a/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx b/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx index 96a08709b800..c736d09ceee1 100644 --- a/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx +++ b/src/components/EmojiPicker/EmojiPickerButtonDropdown.tsx @@ -19,6 +19,10 @@ type EmojiPickerButtonDropdownProps = { /** Flag to disable the emoji picker button */ isDisabled?: boolean; + accessibilityLabel?: string; + + role?: string; + onModalHide: EmojiPickerAction.OnModalHideValue; onInputChange: (emoji: string) => void; @@ -31,7 +35,8 @@ type EmojiPickerButtonDropdownProps = { }; function EmojiPickerButtonDropdown( - {isDisabled = false, onModalHide, onInputChange, value, disabled, style}: EmojiPickerButtonDropdownProps, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + {isDisabled = false, onModalHide, onInputChange, value, disabled, style, ...otherProps}: EmojiPickerButtonDropdownProps, // eslint-disable-next-line @typescript-eslint/no-unused-vars ref: ForwardedRef, ) { diff --git a/src/components/EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.tsx b/src/components/EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.tsx index 71729962002c..8e1112e7844c 100644 --- a/src/components/EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.tsx +++ b/src/components/EmojiPicker/EmojiPickerMenu/BaseEmojiPickerMenu.tsx @@ -4,6 +4,7 @@ import React, {useMemo} from 'react'; import type {ForwardedRef} from 'react'; import {StyleSheet, View} from 'react-native'; import type {StyleProp, ViewStyle} from 'react-native'; +import type {OnyxEntry} from 'react-native-onyx'; import CategoryShortcutBar from '@components/EmojiPicker/CategoryShortcutBar'; import EmojiSkinToneList from '@components/EmojiPicker/EmojiSkinToneList'; import Text from '@components/Text'; @@ -12,7 +13,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import type {EmojiPickerList, EmojiPickerListItem, HeaderIndice} from '@libs/EmojiUtils'; import CONST from '@src/CONST'; -import type {OnyxValue} from '@src/ONYXKEYS'; type BaseEmojiPickerMenuProps = { /** Indicates if the emoji list is filtered or not */ @@ -34,7 +34,7 @@ type BaseEmojiPickerMenuProps = { renderItem: ListRenderItem; /** Extra data to be passed to the list for re-rendering */ - extraData?: Array | ((skinTone: number) => void)>; + extraData?: Array | ((skinTone: number) => void)>; /** Array of indices for the sticky headers */ stickyHeaderIndices?: number[]; diff --git a/src/components/Form/types.ts b/src/components/Form/types.ts index 93da67331c9f..0957e9d67e0e 100644 --- a/src/components/Form/types.ts +++ b/src/components/Form/types.ts @@ -9,6 +9,7 @@ import type AmountTextInput from '@components/AmountTextInput'; import type CheckboxWithLabel from '@components/CheckboxWithLabel'; import type CountrySelector from '@components/CountrySelector'; import type DatePicker from '@components/DatePicker'; +import type EmojiPickerButtonDropdown from '@components/EmojiPicker/EmojiPickerButtonDropdown'; import type Picker from '@components/Picker'; import type RadioButtons from '@components/RadioButtons'; import type RoomNameInput from '@components/RoomNameInput'; @@ -47,7 +48,8 @@ type ValidInputs = | typeof RadioButtons | typeof AmountPicker | typeof TextPicker - | typeof AddPlaidBankAccount; + | typeof AddPlaidBankAccount + | typeof EmojiPickerButtonDropdown; type ValueTypeKey = 'string' | 'boolean' | 'date' | 'country'; type ValueTypeMap = { diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 02d7a14f4b0e..e3e32f398fb6 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -187,7 +187,7 @@ function ReportActionItem({ const reactionListRef = useContext(ReactionListContext); const {updateHiddenAttachments} = useContext(ReportAttachmentsContext); const textInputRef = useRef(); - const popoverAnchorRef = useRef(null); + const popoverAnchorRef = useRef>(null); const downloadedPreviews = useRef([]); const prevDraftMessage = usePrevious(draftMessage); const originalReportID = ReportUtils.getOriginalReportID(report.reportID, action); diff --git a/src/pages/settings/Profile/CustomStatus/StatusPage.tsx b/src/pages/settings/Profile/CustomStatus/StatusPage.tsx index bb7be4a6866c..5dc1c1832d39 100644 --- a/src/pages/settings/Profile/CustomStatus/StatusPage.tsx +++ b/src/pages/settings/Profile/CustomStatus/StatusPage.tsx @@ -162,11 +162,13 @@ function StatusPage({draftStatus, currentUserPersonalDetails}: StatusPageProps) {}} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + onInputChange={(emoji: string): void => {}} />