30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import {View, Text, TextInput, SafeAreaView, Image} from 'react-native'
|
|
import React, {useState} from 'react'
|
|
import {useLocalSearchParams, usePathname} from "expo-router";
|
|
import icons from "@/constants/icons";
|
|
|
|
const Search = () => {
|
|
const path = usePathname();
|
|
const params = useLocalSearchParams<{query?: string}>();
|
|
const [search, setSearch] = useState(params.query);
|
|
|
|
const handleSearch = (text: string) => {
|
|
// console.log(search)
|
|
setSearch(text)
|
|
}
|
|
return (
|
|
<View className={'flex flex-row items-center justify-between w-full px-4 rounded-lg border border-blue-200 mt-5 py-2'}>
|
|
<View className={'flex-1 flex flex-row items-center justify-start z-50'}>
|
|
<Image source={icons.search} className={'size-5'}/>
|
|
<TextInput
|
|
value={search}
|
|
onChangeText={handleSearch}
|
|
placeholder={'Search...'}
|
|
style={{flex: 1, marginLeft: 10}}
|
|
/>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
export default Search
|