uncontrol simple search inputs
This commit is contained in:
@@ -278,7 +278,7 @@ export function SearchablePeopleList({
|
|||||||
) : null}
|
) : null}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={[, web([a.pt_xs])]}>
|
<View style={[web([a.pt_xs])]}>
|
||||||
<SearchInput
|
<SearchInput
|
||||||
inputRef={inputRef}
|
inputRef={inputRef}
|
||||||
value={searchText}
|
value={searchText}
|
||||||
|
|||||||
@@ -82,11 +82,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
<ScreenTransition style={[a.flex_1]} direction={state.transitionDirection}>
|
<ScreenTransition style={[a.flex_1]} direction={state.transitionDirection}>
|
||||||
<View style={[a.border_b, t.atoms.border_contrast_medium]}>
|
<View style={[a.border_b, t.atoms.border_contrast_medium]}>
|
||||||
<View style={[a.py_sm, a.px_md, {height: 60}]}>
|
<View style={[a.py_sm, a.px_md, {height: 60}]}>
|
||||||
<SearchInput
|
<SearchInput defaultValue={query} onChangeText={setQuery} />
|
||||||
value={query}
|
|
||||||
onChangeText={t => setQuery(t)}
|
|
||||||
onClearText={() => setQuery('')}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<List
|
<List
|
||||||
|
|||||||
@@ -66,11 +66,7 @@ export function StepProfiles({
|
|||||||
<ScreenTransition style={[a.flex_1]} direction={state.transitionDirection}>
|
<ScreenTransition style={[a.flex_1]} direction={state.transitionDirection}>
|
||||||
<View style={[a.border_b, t.atoms.border_contrast_medium]}>
|
<View style={[a.border_b, t.atoms.border_contrast_medium]}>
|
||||||
<View style={[a.py_sm, a.px_md, {height: 60}]}>
|
<View style={[a.py_sm, a.px_md, {height: 60}]}>
|
||||||
<SearchInput
|
<SearchInput defaultValue={query} onChangeText={setQuery} />
|
||||||
value={query}
|
|
||||||
onChangeText={setQuery}
|
|
||||||
onClearText={() => setQuery('')}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<List
|
<List
|
||||||
|
|||||||
@@ -155,10 +155,10 @@ export function FeedsScreen(_props: Props) {
|
|||||||
[setQuery, refetchPopularFeeds, debouncedSearch, resetSearch],
|
[setQuery, refetchPopularFeeds, debouncedSearch, resetSearch],
|
||||||
)
|
)
|
||||||
const onPressCancelSearch = React.useCallback(() => {
|
const onPressCancelSearch = React.useCallback(() => {
|
||||||
setQuery('')
|
|
||||||
refetchPopularFeeds()
|
refetchPopularFeeds()
|
||||||
resetSearch()
|
resetSearch()
|
||||||
}, [refetchPopularFeeds, setQuery, resetSearch])
|
}, [refetchPopularFeeds, resetSearch])
|
||||||
|
|
||||||
const onSubmitQuery = React.useCallback(() => {
|
const onSubmitQuery = React.useCallback(() => {
|
||||||
debouncedSearch(query)
|
debouncedSearch(query)
|
||||||
}, [query, debouncedSearch])
|
}, [query, debouncedSearch])
|
||||||
@@ -481,7 +481,7 @@ export function FeedsScreen(_props: Props) {
|
|||||||
<FeedsAboutHeader />
|
<FeedsAboutHeader />
|
||||||
<View style={{paddingHorizontal: 12, paddingBottom: 4}}>
|
<View style={{paddingHorizontal: 12, paddingBottom: 4}}>
|
||||||
<SearchInput
|
<SearchInput
|
||||||
value={query}
|
defaultValue={query}
|
||||||
onChangeText={onChangeQuery}
|
onChangeText={onChangeQuery}
|
||||||
onClearText={onPressCancelSearch}
|
onClearText={onPressCancelSearch}
|
||||||
onSubmitEditing={onSubmitQuery}
|
onSubmitEditing={onSubmitQuery}
|
||||||
|
|||||||
Reference in New Issue
Block a user