add two cols in profile
This commit is contained in:
parent
77e8473cbd
commit
79d581dcf9
|
@ -1,6 +1,14 @@
|
||||||
import React, {useState, useEffect} from 'react';
|
import React, {useState, useEffect} from 'react';
|
||||||
import {Icon, SearchBar} from 'react-native-elements';
|
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';
|
import HouseCard from './helpers/HouseCard';
|
||||||
|
|
||||||
const deviceWidth = Math.round(Dimensions.get('window').width);
|
const deviceWidth = Math.round(Dimensions.get('window').width);
|
||||||
|
@ -48,11 +56,11 @@ const homes = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const UserProfile = ({navigation}) => {
|
const UserProfile = ({navigation}) => {
|
||||||
const [search,setSearch] = React.useState("")
|
const [search, setSearch] = React.useState('');;
|
||||||
const [loading,setLoading] = React.useState(false)
|
const [loading, setLoading] = React.useState(false);;
|
||||||
const [searchData,setSearchData] = React.useState([])
|
const [searchData, setSearchData] = React.useState([]);;
|
||||||
const [tempSearchData,setTempSearchData] = React.useState([])
|
const [tempSearchData, setTempSearchData] = React.useState([]);;
|
||||||
const [error,setError] = React.useState(null)
|
const [error, setError] = React.useState(null);;
|
||||||
const renderHeader = () => {
|
const renderHeader = () => {
|
||||||
return (
|
return (
|
||||||
<SearchBar
|
<SearchBar
|
||||||
|
@ -62,25 +70,27 @@ const UserProfile = ({navigation}) => {
|
||||||
editable={true}
|
editable={true}
|
||||||
value={search}
|
value={search}
|
||||||
onChangeText={setSearch}
|
onChangeText={setSearch}
|
||||||
platform="android"
|
platform="android"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const updateSearch = search => {
|
const updateSearch = search => {
|
||||||
this.setState({ search }, () => {
|
this.setState({search}, () => {
|
||||||
if ('' == search) {
|
if (search == '') {
|
||||||
this.setState({
|
this.setState({
|
||||||
data: [...this.state.temp]
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.state.data = this.state.temp
|
||||||
|
.filter(function (item) {
|
||||||
|
return item.name.includes(search);
|
||||||
|
})
|
||||||
|
.map(function ({id, name, email}) {
|
||||||
|
return {id, name, email};
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -89,16 +99,14 @@ const updateSearch = search => {
|
||||||
<View style={styles.iconContainer}>
|
<View style={styles.iconContainer}>
|
||||||
<TouchableHighlight
|
<TouchableHighlight
|
||||||
onPress={() => navigation.goBack()}
|
onPress={() => navigation.goBack()}
|
||||||
underlayColor="white"
|
underlayColor="white"
|
||||||
activeOpacity={0.5}
|
activeOpacity={0.5}>
|
||||||
>
|
|
||||||
<Icon name="arrow-back" type="ionicon" size={36} color="#206ba5" />
|
<Icon name="arrow-back" type="ionicon" size={36} color="#206ba5" />
|
||||||
</TouchableHighlight>
|
</TouchableHighlight>
|
||||||
<TouchableHighlight
|
<TouchableHighlight
|
||||||
onPress={() => navigation.goBack()}
|
onPress={() => navigation.goBack()}
|
||||||
underlayColor="white"
|
underlayColor="white"
|
||||||
activeOpacity={0.5}
|
activeOpacity={0.5}>
|
||||||
>
|
|
||||||
<Icon
|
<Icon
|
||||||
name="settings-outline"
|
name="settings-outline"
|
||||||
type="ionicon"
|
type="ionicon"
|
||||||
|
@ -115,6 +123,17 @@ underlayColor="white"
|
||||||
<Icon name="card-outline" type="ionicon" size={36} color="brown" />
|
<Icon name="card-outline" type="ionicon" size={36} color="brown" />
|
||||||
<Text style={[styles.pricingHeading]}>Basic Member</Text>
|
<Text style={[styles.pricingHeading]}>Basic Member</Text>
|
||||||
</View>
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 30,justifyContent: "space-evenly"}}>
|
||||||
|
<View style={styles.twoColContainer}>
|
||||||
|
<Text style={[styles.twoColHeading]}>Past Houses</Text>
|
||||||
|
<Text style={[styles.twoColNumber]}>3</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.verticalLine} />
|
||||||
|
<View style={styles.twoColContainer}>
|
||||||
|
<Text style={[styles.twoColHeading]}>Requested</Text>
|
||||||
|
<Text style={[styles.twoColNumber]}>5</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.cardContainer}>
|
<View style={styles.cardContainer}>
|
||||||
{/* <Card /> */}
|
{/* <Card /> */}
|
||||||
|
@ -172,7 +191,7 @@ const styles = StyleSheet.create({
|
||||||
pricingHeading: {
|
pricingHeading: {
|
||||||
color: 'brown',
|
color: 'brown',
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
textAlign: 'left',
|
textAlign: 'center',
|
||||||
fontFamily: 'Ubuntu-Regular',
|
fontFamily: 'Ubuntu-Regular',
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
},
|
},
|
||||||
|
@ -181,12 +200,36 @@ const styles = StyleSheet.create({
|
||||||
marginLeft: '28%',
|
marginLeft: '28%',
|
||||||
flexDirection: 'row',
|
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: {
|
cardContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
// justifyContent: 'center',
|
// justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
verticalLine: {
|
||||||
|
marginLeft: -40,
|
||||||
|
height: '100%',
|
||||||
|
width: 5,
|
||||||
|
backgroundColor: '#206ba5',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default UserProfile;
|
export default UserProfile;
|
||||||
|
|
Loading…
Reference in New Issue