Commit 6ff2ba1c authored by zarina's avatar zarina 🌊

изменен интерфейс (добавлен верхний отступ, расширена область клика у кнопки)

parent 72013c72
...@@ -3,7 +3,7 @@ import {StyleSheet, Image, Text, TouchableHighlight, View} from "react-native"; ...@@ -3,7 +3,7 @@ import {StyleSheet, Image, Text, TouchableHighlight, View} from "react-native";
const FullContact = props => { const FullContact = props => {
return ( return (
<View style={{marginTop: 22, flex: 1}}> <View style={{flex: 1, alignItems: 'center', marginTop: 70}}>
<View> <View>
<Image source={{uri: props.contact.photo}} style={styles.image}/> <Image source={{uri: props.contact.photo}} style={styles.image}/>
<Text style={styles.contactProps}>Name: {props.contact.name}</Text> <Text style={styles.contactProps}>Name: {props.contact.name}</Text>
...@@ -24,14 +24,14 @@ export default FullContact; ...@@ -24,14 +24,14 @@ export default FullContact;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
image: { image: {
width: 200, width: 250,
height: 200, height: 250,
marginRight: 10 marginRight: 10
}, },
btn: { btn: {
position: 'absolute', position: 'absolute',
bottom: 0, bottom: 0,
padding: 20, padding: 40,
borderRadius: 5, borderRadius: 5,
backgroundColor: 'rgba(0,0,0,0.7)', backgroundColor: 'rgba(0,0,0,0.7)',
width: '100%' width: '100%'
......
...@@ -26,14 +26,13 @@ class Main extends Component { ...@@ -26,14 +26,13 @@ class Main extends Component {
render() { render() {
let contacts = []; let contacts = [];
for (let contact in this.props.contacts) { for (let contact in this.props.contacts) {
let contactProps = this.props.contacts[contact];
contacts.push( contacts.push(
{ {
id: contact, name: this.props.contacts[contact].name,
photo: contactProps.photo, photo: this.props.contacts[contact].photo,
name: contactProps.name, email: this.props.contacts[contact].email,
email: contactProps.email, phone: this.props.contacts[contact].phone,
phone: contactProps.phone id: contact
}) })
} }
return ( return (
...@@ -67,7 +66,6 @@ class Main extends Component { ...@@ -67,7 +66,6 @@ class Main extends Component {
} }
} }
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
contacts: state.contacts contacts: state.contacts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment