Guest User

Untitled

a guest
Jan 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. handleClick = (link) => {
  2. Linking.canOpenURL(link).then(supported => {
  3. if (supported) {
  4. Linking.openURL(link);
  5. } else {
  6. console.log('Don't know how to open URI: ' + link);
  7. }
  8. });
  9. };
  10.  
  11.  
  12. <View style={styles.AddressRow}>
  13. {
  14. item.Online != ''? <TouchableOpacity onPress={() => Linking.openURL( item.Online )}>
  15. </TouchableOpacity>: null
  16.  
  17. }
  18.  
  19.  
  20. <TouchableOpacity onPress={() => Linking.openURL(item.Online)}>
  21. <Text style={styles.underLineText}>Online</Text>
  22. </TouchableOpacity>
  23.  
  24. [
  25.  
  26.  
  27. {
  28. "id":"1",
  29. "fk": 1,
  30. "addr": "Test Drive",
  31. "phone": "951-955-6200",
  32. "LatL":"33.9",
  33. "Long2":"-117.373423",
  34. "Online": "http://www.test.com",
  35.  
  36. "image" : "png"
  37. },
  38.  
  39.  
  40.  
  41. {
  42. "id":"3",
  43. "fk": 1,
  44. "addr": "880 N State St, Hemet 92543-1496",
  45. "phone": "951-955-6200",
  46. "LatL":"33.7",
  47. "Long2":"-116.971169",
  48. "Online": "",
  49. "image" : "Home"
  50.  
  51.  
  52. }
  53. ]
  54.  
  55. <View style={styles.AddressRow}>
  56. {item.Online !== '' && <TouchableOpacity onPress={() => Linking.openURL(item.Online)}>
  57. <Text style={styles.underLineText}>Online</Text>
  58. </TouchableOpacity>}
Add Comment
Please, Sign In to add comment