Guest User

Untitled

a guest
Nov 23rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. <View style ={styles.inside2}>
  2. {
  3. this.state.categorias.map((categoria) => {
  4. return(
  5. <View key={categoria.id}>
  6. <CheckBox
  7. title={categoria.nombre}
  8. iconRight
  9. checkedColor='red'
  10. uncheckedColor='red'
  11. checked={this.state.checkCategorias[categoria.id-1]}
  12. containerStyle ={{backgroundColor: '#f7f7f7', borderColor: '#f7f7f7' }}
  13. textStyle = {{fontSize: 12, color: '#787878' }}
  14. checkedIcon = 'dot-circle-o'
  15. uncheckedIcon = 'circle-o'
  16. onPress = {(checked) => this.cambioCheckCat(categoria.id)}
  17. />
  18. {
  19. this.state.checkCategorias[categoria.id-1] ?
  20. <View
  21. style ={{backgroundColor: 'lightgray', width: '100%', height: '100%'}}
  22. key ={categoria.id+'t'} >
  23. <Text style = {styles.titulo2}>
  24. Seleccione una o varias sub-categorias de {categoria.nombre}
  25. </Text>
  26. <View style={styles.separador} />
  27. {
  28. this.state.subcategorias.map((subcategoria) => {
  29. if(subcategoria.id_categoria == categoria.id){
  30. return(
  31. <CheckBox
  32. key={subcategoria.id+'s'}
  33. title={subcategoria.nombre}
  34. iconRight
  35. checkedColor='red'
  36. uncheckedColor='red'
  37. checked={this.state.checkSubCategorias[i]}
  38. containerStyle ={{backgroundColor: '#f7f7f7', borderColor: '#f7f7f7' }}
  39. textStyle = {{fontSize: 12, color: '#787878' }}
  40. checkedIcon = 'dot-circle-o'
  41. uncheckedIcon = 'circle-o'
  42. onPress = {(checked) => this.cambioCheckSub(subcategoria.id)}
  43. />
  44. )
  45. }
  46. })
  47. }
  48. </View> : null
  49. }
  50. </View>
  51. )
  52. })
  53. }
  54. </View>
Add Comment
Please, Sign In to add comment