Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import React from 'react';
  2. import { View, Text, TextInput, TouchableOpacity, ScrollView } from 'react-native';
  3. import {Card, Button, Avatar, Grid, Row, Col, ButtonGroup} from 'react-native-elements'
  4. // import { connect } from 'react-redux';
  5. // import { Actions } from 'react-native-router-flux';
  6.  
  7. import styles from '../styles'
  8.  
  9.  
  10. // mapStateToProps = (state) => ({ barcodes: state.barcodeReducer.barcodes });
  11.  
  12. // mapDispatchToProps = (dispatch) => ({
  13. // // addGroceryItem: (groceryItem) => {
  14. // // dispatch(addToGroceryList(groceryItem));
  15. // // },
  16. // // addTodoItem: (todoItem) => {
  17. // // dispatch(addToTodoList(todoItem));
  18. // // },
  19. // });
  20.  
  21. export default class ResultsContent extends React.Component {
  22. // constructor(props) {
  23. // super(props);
  24. // }
  25.  
  26. renderResultsContent() {
  27. return(
  28. <ScrollView>
  29. <Card title='Pikachu (me)'>
  30. <Text>No alerts!</Text>
  31. </Card>
  32. <Card title='Eevee'>
  33. <Text>3 potential ingredient alerts:</Text>
  34. <Text>
  35. - Crushed almond (Tree Nut), Butter (Dairy), Soymilk (Soy)</Text>
  36.  
  37. </Card>
  38. <Card title='Charmander'>
  39. <Text>No alerts!</Text>
  40. </Card>
  41. <Card title='Squirtle'>
  42. <Text>No alerts!</Text>
  43. </Card>
  44. </ScrollView>
  45. )
  46. }
  47.  
  48. renderNutritionContent() {
  49. return(
  50. <ScrollView>
  51. <Text>Test Nutrition</Text>
  52. </ScrollView>
  53. )
  54. }
  55.  
  56. renderContent() {
  57. const {selectedTab} = this.props;
  58.  
  59. if (selectedTab == 0) {
  60. return this.renderResultsContent();
  61. } else if (selectedTab == 1) {
  62. return this.renderNutritionContent();
  63. }
  64. }
  65.  
  66. render() {
  67. return(
  68. <View>
  69. {this.renderContent()}
  70. </View>
  71. )
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement