|
|
@@ -1,6 +1,7 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import { Text, ListView, View, Image, TextInput } from 'react-native';
|
|
|
import { Card, CardSection, Button } from '../../components/common';
|
|
|
+import Header from './Header';
|
|
|
|
|
|
class Comentarios extends Component {
|
|
|
|
|
|
@@ -82,6 +83,15 @@ class Comentarios extends Component {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ renderHeader() {
|
|
|
+ const out = (
|
|
|
+ <View>
|
|
|
+ <Header titulo={this.props.titulo} profesor={this.props.profesor} fecha={this.props.fecha} />
|
|
|
+ {this.renderNewComment()}
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ return out;
|
|
|
+ }
|
|
|
renderNewComment() {
|
|
|
return (
|
|
|
<Card>
|
|
|
@@ -108,7 +118,7 @@ class Comentarios extends Component {
|
|
|
this.props.comentarios.length === 0) {
|
|
|
return (
|
|
|
<View style={{ margin: 10 }}>
|
|
|
- { this.renderNewComment()}
|
|
|
+ {this.renderNewComment()}
|
|
|
<Text style={{ fontSize: 14, alignSelf: 'center' }}>
|
|
|
Aún no hay comentarios
|
|
|
</Text>
|
|
|
@@ -119,7 +129,7 @@ class Comentarios extends Component {
|
|
|
return (
|
|
|
<ListView
|
|
|
enableEmptySections
|
|
|
- renderHeader={this.renderNewComment}
|
|
|
+ renderHeader={this.renderHeader.bind(this)}
|
|
|
dataSource={this.dataSource}
|
|
|
renderRow={this.renderComentario.bind(this)}
|
|
|
/>
|