diff --git a/ts/components/LeftPane.tsx b/ts/components/LeftPane.tsx index 74b304b110..47768b98d3 100644 --- a/ts/components/LeftPane.tsx +++ b/ts/components/LeftPane.tsx @@ -714,6 +714,10 @@ export function LeftPane({ updateSearchTerm, onChangeComposeSelectedRegion: setComposeSelectedRegion, showConversation, + lookupConversationWithoutServiceId, + showUserNotFoundModal, + setIsFetchingUUID, + showInbox, })} )} diff --git a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx index e963a4a3e4..d066a235bb 100644 --- a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx +++ b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx @@ -15,6 +15,7 @@ import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance'; import type { UUIDFetchStateType } from '../../util/uuidFetchState'; import type { CountryDataType } from '../../util/getCountryData'; import { isFetchingByE164 } from '../../util/uuidFetchState'; +import { drop } from '../../util/drop'; import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId'; import { Spinner } from '../Spinner'; import { Button } from '../Button'; @@ -28,6 +29,12 @@ export type LeftPaneFindByPhoneNumberPropsType = { countries: ReadonlyArray; }; +type DoLookupActionsType = Readonly<{ + showInbox: () => void; + showConversation: ShowConversationType; +}> & + LookupConversationWithoutServiceIdActionsType; + export class LeftPaneFindByPhoneNumberHelper extends LeftPaneHelper { private readonly searchTerm: string; @@ -100,13 +107,15 @@ export class LeftPaneFindByPhoneNumberHelper extends LeftPaneHelper ) => unknown; onChangeComposeSelectedRegion: (newRegion: string) => void; - }>): ReactChild { + }> & + DoLookupActionsType): ReactChild { const placeholder = i18n( 'icu:LeftPaneFindByHelper__placeholder--findByPhoneNumber' ); @@ -129,6 +138,11 @@ export class LeftPaneFindByPhoneNumberHelper extends LeftPaneHelper { + if (ev.key === 'Enter') { + drop(this.doLookup(lookupActions)); + } + }} /> ); @@ -136,38 +150,15 @@ export class LeftPaneFindByPhoneNumberHelper extends LeftPaneHelper void; - showConversation: ShowConversationType; }> & - LookupConversationWithoutServiceIdActionsType): ReactChild { + DoLookupActionsType): ReactChild { return (