Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { View, Animated, StyleSheet, Text, Image } from 'react-native';
  3. import { Card, Button } from 'react-native-elements';
  4.  
  5. import Deck from '../Deck'
  6.  
  7. const DATA = [
  8. { id: 1, text: 'Job #1', boss: 'Boss #1', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-04.jpg' },
  9. { id: 2, text: 'Job #2', boss: 'Boss #2', dStart: '01/01/0001', place: 'Home', uri: 'http://www.fluxdigital.co/wp-content/uploads/2015/04/Unsplash.jpg' },
  10. { id: 3, text: 'Job #3', boss: 'Boss #3', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-09.jpg' },
  11. { id: 4, text: 'Job #4', boss: 'Boss #4', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-01.jpg' },
  12. { id: 5, text: 'Job #5', boss: 'Boss #5', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-04.jpg' },
  13. { id: 6, text: 'Job #6', boss: 'Boss #6', dStart: '01/01/0001', place: 'Home', uri: 'http://www.fluxdigital.co/wp-content/uploads/2015/04/Unsplash.jpg' },
  14. { id: 7, text: 'Job #7', boss: 'Boss #7', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-09.jpg' },
  15. { id: 8, text: 'Job #8', boss: 'Boss #8', dStart: '01/01/0001', place: 'Home', uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-01.jpg' },
  16. ];
  17.  
  18. export default class Jobs extends React.Component {
  19.  
  20. //call every time when we will take something from Deck
  21. renderCard(item) {
  22. return (
  23. <Card
  24. key={item.id}
  25. title={item.text}>
  26. <Image source= {{uri: 'http://imgs.abduzeedo.com/files/paul0v2/unsplash/unsplash-04.jpg'}}/>
  27. <Text>
  28. {item.boss}
  29. </Text>
  30. <Text>
  31. title={item.text}
  32. </Text>
  33. <Text>
  34. Date: {item.dStart}
  35. </Text>
  36. <Text>
  37. Where: {item.place}
  38. </Text>
  39. <Button
  40. icon={{ name: 'code' }}
  41. backgroundColor="#03A9F4"
  42. title="Show More Details"
  43. />
  44. </Card>
  45. );
  46. }
  47.  
  48.  
  49. renderNoMoreCards() {
  50. return (
  51. <Card title="No More Hot Jobs For You">
  52. <Text style={{ marginBottom: 10 }}>
  53. Wait For The Job Call
  54. </Text>
  55. <Button
  56. backgroundColor="#03A9F4"
  57. title="Works You're Waiting For"
  58. />
  59. </Card>
  60. );
  61. }
  62.  
  63. render() {
  64. return (
  65. <View style={styles.container}>
  66. <Deck
  67. data={DATA}
  68. renderCard={this.renderCard}
  69. renderNoMoreCards={this.renderNoMoreCards}
  70. />
  71. </View>
  72. );
  73. }
  74. }
  75.  
  76. const styles = StyleSheet.create({
  77.  
  78. container: {
  79. flex: 1,
  80. flexDirection: 'row',
  81. justifyContent: 'space-between'
  82. },
  83.  
  84. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement