Guest User

Untitled

a guest
Nov 14th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. renderRow(post) {
  2. var datePosted = new Date(post.publish_date).toString();
  3. return(
  4. <TouchableHighlight underlayColor='transparent' onPress={() => this.onPostPress(post)}>
  5. <View style={styles.row}>
  6. <Image style={styles.image} source={{uri: post.featured_image.replace(/^http:///i, 'https://')}} /> {/* Here's the error */}
  7. <View style={styles.info}>
  8. <Text style={styles.title}>{post.title}</Text>
  9. <Text style={styles.author}>Por {post.author_name}</Text>
  10. <Text style={styles.date}>{datePosted.substr(4,11)}</Text>
  11. <Text numberOfLines={3} style={styles.description}>{post.meta_description}..</Text>
  12. </View>
  13. </View>
  14. </TouchableHighlight>
  15. );
  16. }
  17.  
  18. render() {
  19. return(
  20. <ListView
  21. dataSource={this.state.dataSource}
  22. renderRow={this.renderRow.bind(this)}
  23. style={styles.page}
  24. />
  25. );
  26. }
  27.  
  28. if(post.featured_image != undefined) {
  29. var imageHttps = post.featured_image.replace(/^http:///i, 'https://');
  30. }
Add Comment
Please, Sign In to add comment