|
|
@@ -1,7 +1,7 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import { Text, ListView, View, TouchableOpacity, Image } from 'react-native';
|
|
|
import { Actions } from 'react-native-router-flux';
|
|
|
-import { Card, CardSection, Button } from '../common';
|
|
|
+import { Card, CardSection, Button, Input } from '../common';
|
|
|
|
|
|
class Comentarios extends Component {
|
|
|
|
|
|
@@ -47,15 +47,40 @@ class Comentarios extends Component {
|
|
|
</Card>
|
|
|
);
|
|
|
}
|
|
|
- render() {
|
|
|
- //console.log("teoria", this.props);
|
|
|
- return (
|
|
|
+
|
|
|
+ renderList() {
|
|
|
+ if (this.props.comentarios === undefined ||
|
|
|
+ this.props.comentarios.length == 0 ) {
|
|
|
+ return (
|
|
|
+ <View>
|
|
|
+ <Text> Aún no hay comentarios </Text>
|
|
|
+ <Card >
|
|
|
+ <CardSection>
|
|
|
+ <Text> Dejar un comentario </Text>
|
|
|
+ </CardSection>
|
|
|
+ <CardSection>
|
|
|
+ <Input multiline={true} placeholder="comentario"></Input>
|
|
|
+ </CardSection>
|
|
|
+ <CardSection>
|
|
|
+ <Button>Enviar</Button>
|
|
|
+ </CardSection>
|
|
|
+ </Card>
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
<ListView
|
|
|
+ enableEmptySections
|
|
|
dataSource={this.dataSource}
|
|
|
renderRow={this.renderComentario.bind(this)}
|
|
|
style={{flex:1, marginBottom:50}}
|
|
|
/>
|
|
|
);
|
|
|
+ }
|
|
|
+ render() {
|
|
|
+ //console.log("teoria", this.props);
|
|
|
+ return this.renderList();
|
|
|
}
|
|
|
}
|
|
|
|