marker: start working on cards
This commit is contained in:
1 parent
70615202dc
commit
fb090fca55
4 files changed
+46
-13
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import {View, Text} from 'react-native'
|
||||
import React from 'react'
|
||||
|
||||
const Cards = () => {
|
||||
return (
|
||||
<View>
|
||||
<Text>Cards</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
export default Cards
|
||||
+16
-4
@@ -1,16 +1,25 @@
|
||||
import {View, Text, TextInput, SafeAreaView, Image} from 'react-native'
|
||||
import {View, Text, TextInput, SafeAreaView, Image, TouchableOpacity} from 'react-native'
|
||||
import React, {useState} from 'react'
|
||||
import {useLocalSearchParams, usePathname} from "expo-router";
|
||||
import {router, useLocalSearchParams, usePathname} from "expo-router";
|
||||
import icons from "@/constants/icons";
|
||||
import {useDebouncedCallback} from "use-debounce";
|
||||
|
||||
const Search = () => {
|
||||
const path = usePathname();
|
||||
const params = useLocalSearchParams<{query?: string}>();
|
||||
const [search, setSearch] = useState(params.query);
|
||||
|
||||
// we will optimize search with debounce
|
||||
|
||||
const debounceSearch = useDebouncedCallback(
|
||||
(text: string) => router.setParams({ query: text }),
|
||||
300 // debounce delay in milliseconds
|
||||
);
|
||||
|
||||
const handleSearch = (text: string) => {
|
||||
// console.log(search)
|
||||
setSearch(text)
|
||||
console.log(search)
|
||||
setSearch(text);
|
||||
debounceSearch(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'}>
|
||||
@@ -23,6 +32,9 @@ const Search = () => {
|
||||
style={{flex: 1, marginLeft: 10}}
|
||||
/>
|
||||
</View>
|
||||
<TouchableOpacity>
|
||||
<Image source={icons.filter} className={'size-5'}/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user