|
@@ -6,6 +6,7 @@ import Tabs from 'react-native-tabs';
|
|
|
import { claseFetch } from '../actions/';
|
|
import { claseFetch } from '../actions/';
|
|
|
import Teoria from './Clase/Teoria';
|
|
import Teoria from './Clase/Teoria';
|
|
|
import Comentarios from './Clase/Comentarios';
|
|
import Comentarios from './Clase/Comentarios';
|
|
|
|
|
+import { Spinner } from '../components/common/';
|
|
|
|
|
|
|
|
class Clase extends Component {
|
|
class Clase extends Component {
|
|
|
state = { page: 'Teoria' };
|
|
state = { page: 'Teoria' };
|
|
@@ -26,7 +27,9 @@ class Clase extends Component {
|
|
|
}
|
|
}
|
|
|
render() {
|
|
render() {
|
|
|
const { clase } = this.props;
|
|
const { clase } = this.props;
|
|
|
- console.log(clase);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (this.props.loading)
|
|
|
|
|
+ return <Spinner size="large" />;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<View style={styles.container, {flex:1}}>
|
|
<View style={styles.container, {flex:1}}>
|
|
@@ -55,8 +58,8 @@ const styles = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
const mapStateToProps = state => {
|
|
|
- const { curClase } = state.cursadasR;
|
|
|
|
|
- return { clase: curClase };
|
|
|
|
|
|
|
+ const { curClase, loading } = state.cursadasR;
|
|
|
|
|
+ return { loading, clase: curClase };
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, { claseFetch })(Clase);
|
|
export default connect(mapStateToProps, { claseFetch })(Clase);
|