|
|
@@ -0,0 +1,43 @@
|
|
|
+import _ from 'lodash';
|
|
|
+import React, { Component } from 'react';
|
|
|
+import { Text, WebView, View } from 'react-native';
|
|
|
+import { connect } from 'react-redux';
|
|
|
+import { Actions } from 'react-native-router-flux';
|
|
|
+import { claseFetch } from '../actions/';
|
|
|
+import { Card, CardSection, Button } from './common';
|
|
|
+
|
|
|
+class Clase extends Component {
|
|
|
+
|
|
|
+ componentWillMount() {
|
|
|
+ this.props.claseFetch(this.props);
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ 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}
|
|
|
+ source={{html: clase.texto}} />
|
|
|
+ </CardSection>
|
|
|
+ </Card>
|
|
|
+ );
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const mapStateToProps = state => {
|
|
|
+ const { curClase } = state.cursadasR;
|
|
|
+ console.log("State:", state);
|
|
|
+ return { clase: curClase };
|
|
|
+};
|
|
|
+
|
|
|
+export default connect(mapStateToProps, { claseFetch })(Clase);
|