Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. import React, {Component} from 'react';
  2. import { View, Text } from 'react-native';
  3. // import { NavigationEvents } from 'react-navigation';
  4. import styles from './style';
  5. import { Icon, Button } from 'react-native-elements'
  6. // import * as contacts from '../../components/GetContacts/index'
  7. import {Linking} from 'react-native'
  8.  
  9. class ContactView extends Component {
  10. static navigationOptions = {
  11. headerStyle: {
  12. backgroundColor: '#23303b',
  13. },
  14. headerRight: () => (
  15. <Icon name='ios-add' type='ionicon' color='white' size={40}
  16. onPress={ () => this.props.navigation.navigate('CreateContact')}
  17. />
  18. ),
  19. };
  20. render(){
  21. const { getParam } = this.props.navigation
  22. return(
  23. <View style={styles.body}>
  24. <View style={styles.contactPhoto}/>
  25. <View style={styles.textIcon}>
  26. <View style={styles.textView}>
  27. <Text style={styles.contactName}>{getParam('name')}</Text>
  28. <Text style={styles.contactNumber}>{getParam('phoneNumber')}</Text>
  29. </View>
  30.  
  31. <View style={styles.iconView}>
  32. <Icon
  33. style={ styles.icon }
  34. name='ios-call' color={'#23303b'} size={30} type='ionicon' reverse
  35. onPress={()=> Linking.openURL(`tel:${getParam('phoneNumber')}`)}
  36. />
  37. </View>
  38. </View>
  39.  
  40. <View style={styles.buttonView}>
  41. <Button
  42. style={styles.button}
  43. title='Edit contact'
  44. type='solid'
  45. onPress={()=> this.props.navigation.navigate('EditContact', { name: getParam('name'), phoneNumber: getParam('phoneNumber') })}/>
  46. </View>
  47.  
  48.  
  49. </View>
  50. );
  51. }
  52. }
  53.  
  54.  
  55. export default ContactView;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement