feat: searchbar

This commit is contained in:
Jakob Stornig 2023-12-07 11:50:01 +01:00
parent c1bea51576
commit 38ff1322c3
3 changed files with 81 additions and 9 deletions

View file

@ -1,8 +1,8 @@
import { StyleSheet, View, Text, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import { useThemeColor } from "../hooks/hooks";
import { SafeAreaView } from 'react-native-safe-area-context'
import { ExpenseItem, Plus, Welcome } from '../components';
import { FlatList } from 'react-native-gesture-handler';
import { ExpenseItem, Plus, Welcome, SearchBar } from '../components';
import { FlatList, TextInput } from 'react-native-gesture-handler';
import { useRef, useState } from 'react';
import React from 'react';
@ -50,23 +50,25 @@ export default function Page() {
return (
<SafeAreaView>
<SafeAreaView style={{flex: 1}}>
{plusShow && <Plus/>}
{/* <Welcome name="My User" image={profile} onPress={()=>console.log("hello")}></Welcome> */}
<FlatList
data={data}
ListHeaderComponent={<Welcome name="My User" image={profile} onPress={()=>console.log("hello")}></Welcome>
}
ListHeaderComponent={
<>
<Welcome name="My Dude" image={profile} onPress={()=>console.log("hello")}></Welcome>
<SearchBar placeholder='Type to Search...'></SearchBar>
</>
}
renderItem = {({item}) => <ExpenseItem category={item.category} color={item.color} date={item.date} title={item.title} value={item.value}/>}
keyExtractor={item => item.id}
ItemSeparatorComponent={()=><View style={{marginVertical: 5}}></View>}
onScroll={handleScroll}
scrollEventThrottle={20}
>
</FlatList>
</FlatList>
</SafeAreaView>
);