diff --git a/components/UserProfile.js b/components/UserProfile.js index ec39bd4..f39b55a 100644 --- a/components/UserProfile.js +++ b/components/UserProfile.js @@ -1,6 +1,14 @@ import React, {useState, useEffect} from 'react'; import {Icon, SearchBar} from 'react-native-elements'; -import {StatusBar, Dimensions, StyleSheet, Text, View, TouchableHighlight,FlatList} from 'react-native'; +import { + StatusBar, + Dimensions, + StyleSheet, + Text, + View, + TouchableHighlight, + FlatList, +} from 'react-native'; import HouseCard from './helpers/HouseCard'; const deviceWidth = Math.round(Dimensions.get('window').width); @@ -48,11 +56,11 @@ const homes = [ }, ]; const UserProfile = ({navigation}) => { - const [search,setSearch] = React.useState("") - const [loading,setLoading] = React.useState(false) - const [searchData,setSearchData] = React.useState([]) - const [tempSearchData,setTempSearchData] = React.useState([]) - const [error,setError] = React.useState(null) + const [search, setSearch] = React.useState('');; + const [loading, setLoading] = React.useState(false);; + const [searchData, setSearchData] = React.useState([]);; + const [tempSearchData, setTempSearchData] = React.useState([]);; + const [error, setError] = React.useState(null);; const renderHeader = () => { return ( { editable={true} value={search} onChangeText={setSearch} - platform="android" + platform="android" /> ); }; -const updateSearch = search => { - this.setState({ search }, () => { - if ('' == search) { - this.setState({ - data: [...this.state.temp] - }); - return; - } - - this.state.data = this.state.temp.filter(function(item){ - return item.name.includes(search); - }).map(function({id, name, email}){ - return {id, name, email}; - }); + const updateSearch = search => { + this.setState({search}, () => { + if (search == '') { + this.setState({ + data: [...this.state.temp], }); + return; + } + + this.state.data = this.state.temp + .filter(function (item) { + return item.name.includes(search); + }) + .map(function ({id, name, email}) { + return {id, name, email}; + }); + }); }; return ( <> @@ -89,16 +99,14 @@ const updateSearch = search => { navigation.goBack()} -underlayColor="white" - activeOpacity={0.5} - > + underlayColor="white" + activeOpacity={0.5}> navigation.goBack()} -underlayColor="white" - activeOpacity={0.5} - > + underlayColor="white" + activeOpacity={0.5}> Basic Member + + + Past Houses + 3 + + + + Requested + 5 + + {/* */} @@ -172,7 +191,7 @@ const styles = StyleSheet.create({ pricingHeading: { color: 'brown', fontSize: 30, - textAlign: 'left', + textAlign: 'center', fontFamily: 'Ubuntu-Regular', paddingLeft: 10, }, @@ -181,12 +200,36 @@ const styles = StyleSheet.create({ marginLeft: '28%', flexDirection: 'row', }, + twoColContainer: { + flexDirection: 'column', + alignItems: 'center', + marginLeft: -40, + }, + twoColHeading: { + color: '#1C254E', + fontSize: 28, + textAlign: 'left', + fontFamily: 'Ubuntu-Regular', + }, + twoColNumber: { + textAlign: 'center', + fontSize: 55, + textAlign: 'left', + fontFamily: 'Ubuntu-Regular', + color: '#206ba5', + }, cardContainer: { flex: 1, backgroundColor: 'white', alignItems: 'center', // justifyContent: 'center', }, + verticalLine: { + marginLeft: -40, + height: '100%', + width: 5, + backgroundColor: '#206ba5', + }, }); export default UserProfile;