Add search event analytics (#9949)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
DS Boyce
2026-03-03 12:49:38 -08:00
committed by GitHub
parent 37a82761f5
commit 7dc3b4fa8e
10 changed files with 291 additions and 120 deletions
+7 -8
View File
@@ -1,7 +1,6 @@
import React from 'react'
import {forwardRef} from 'react'
import {type TextInput, View} from 'react-native'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {useLingui} from '@lingui/react/macro'
import {HITSLOP_10} from '#/lib/constants'
import {atoms as a, useTheme} from '#/alf'
@@ -19,10 +18,10 @@ type SearchInputProps = Omit<TextField.InputProps, 'label'> & {
onClearText?: () => void
}
export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
export const SearchInput = forwardRef<TextInput, SearchInputProps>(
function SearchInput({value, label, onClearText, ...rest}, ref) {
const t = useTheme()
const {_} = useLingui()
const {t: l} = useLingui()
const showClear = value && value.length > 0
return (
@@ -31,9 +30,9 @@ export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
<TextField.Icon icon={MagnifyingGlassIcon} />
<TextField.Input
inputRef={ref}
label={label || _(msg`Search`)}
label={label || l`Search`}
value={value}
placeholder={_(msg`Search`)}
placeholder={l`Search`}
returnKeyType="search"
keyboardAppearance={t.scheme}
selectTextOnFocus={IS_NATIVE}
@@ -67,7 +66,7 @@ export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
<Button
testID="searchTextInputClearBtn"
onPress={onClearText}
label={_(msg`Clear search query`)}
label={l`Clear search query`}
hitSlop={HITSLOP_10}
size="tiny"
shape="round"