Parcourir la source

boton de prof en clase

David il y a 9 ans
Parent
commit
d13f28136d
2 fichiers modifiés avec 29 ajouts et 22 suppressions
  1. 29 21
      src/components/Clase.js
  2. 0 1
      src/components/Cursada.js

+ 29 - 21
src/components/Clase.js

@@ -1,6 +1,6 @@
 import _ from 'lodash';
 import React, { Component } from 'react';
-import { Text, WebView, View } from 'react-native';
+import { Text, WebView, ScrollView, View, TouchableOpacity } from 'react-native';
 import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
 import { claseFetch } from '../actions/';
@@ -16,26 +16,34 @@ class Clase extends Component  {
     const { clase } = this.props;
     console.log("props", this.props);
 		return (
-      <Card>
-        <CardSection>
-          <Text>{clase.titulo}</Text>
-        </CardSection>
-        <CardSection>
-          <Text>{clase.profesor.nombre} {clase.profesor.apellido}</Text>
-        </CardSection>
-        <CardSection>
-            <WebView
-              style={{height:300}}
-              scalesPageToFit={true}
-              javaScriptEnabled={false}
-              source={{html: clase.texto}} />
-        </CardSection>
-        <CardSection>
-          <Text>
-            Comentarios
-          </Text>
-        </CardSection>
-      </Card>
+			<ScrollView>
+	      <Card>
+	        <CardSection>
+	          <Text>{clase.titulo}</Text>
+	        </CardSection>
+
+	        <CardSection>
+						<TouchableOpacity onPress={() => Actions.ViewProf({ id: clase.profesor._id})}>
+							<Text style={{flex:1, color: '#007aff', fontWeight: '600'}}>
+								{clase.profesor.nombre} {clase.profesor.apellido}
+							</Text>
+						</TouchableOpacity>
+	        </CardSection>
+
+	        <CardSection>
+	            <WebView
+	              style={{height:1700}}
+	              scalesPageToFit={true}
+	              javaScriptEnabled={false}
+	              source={{html: clase.texto}} />
+	        </CardSection>
+	        <CardSection>
+	          <Text>
+	            Comentarios
+	          </Text>
+	        </CardSection>
+	      </Card>
+			</ScrollView>
 		);
 	}
 };

+ 0 - 1
src/components/Cursada.js

@@ -26,7 +26,6 @@ class Cursada extends Component  {
 	}
 
 	onProfPress(id){
-		console.log("profid", id);
 		Actions.ViewProf({ id });
 	}