ソースを参照

flex clase-view to actually take 100% of the screen

David 9 年 前
コミット
74b7420381
2 ファイル変更29 行追加17 行削除
  1. 1 2
      src/components/Clase.js
  2. 28 15
      src/components/Clase/Comentarios.js

+ 1 - 2
src/components/Clase.js

@@ -1,6 +1,5 @@
 import React, { Component } from 'react';
 import { View, Text } from 'react-native';
-import { Scene } from 'react-native-router-flux'
 import { connect } from 'react-redux';
 import Tabs from 'react-native-tabs';
 
@@ -30,7 +29,7 @@ class Clase extends Component {
     console.log(clase);
 
     return (
-      <View style={styles.container}>
+      <View style={styles.container, {flex:1}}>
         <Tabs selected={this.state.page} style={{backgroundColor:'white'}}
           selectedStyle={{fontWeight:"700"}}
           onSelect={ el => {

+ 28 - 15
src/components/Clase/Comentarios.js

@@ -1,7 +1,7 @@
 import React, { Component } from 'react';
-import { Text, ListView, View, TouchableOpacity, Image } from 'react-native';
+import { Text, ListView, View, TouchableOpacity, Image, TextInput } from 'react-native';
 import { Actions } from 'react-native-router-flux';
-import { Card, CardSection, Button, Input } from '../common';
+import { Card, CardSection, Button } from '../common';
 
 class Comentarios extends Component {
 
@@ -48,23 +48,36 @@ class Comentarios extends Component {
     );
   }
 
+  renderNewComment() {
+    return (
+      <Card>
+        <CardSection>
+          <Text style={{backgroundColor:'red',justifyContent:'center'}}>
+            Dejar un comentario
+          </Text>
+        </CardSection>
+        <CardSection>
+          <TextInput
+            autoCorrect={true}
+            multiline={true}
+            style={{flex:1}}
+          />
+        </CardSection>
+        <CardSection>
+          <Button>Enviar</Button>
+        </CardSection>
+      </Card>
+  );
+  }
   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 style={{margin:10}}>
+              <Text style={{fontSize:14,alignSelf:'center'}}>
+                Aún no hay comentarios
+              </Text>
+              {this.renderNewComment()}
             </View>
           );
     }