David 9 лет назад
Родитель
Сommit
e443075f29
42 измененных файлов с 831 добавлено и 830 удалено
  1. 3 0
      package.json
  2. 3 3
      src/App.js
  3. 23 21
      src/Router.js
  4. 3 3
      src/actions/AuthActions.js
  5. 27 28
      src/actions/CursadaActions.js
  6. 18 16
      src/actions/LocalStorageActions.js
  7. 24 24
      src/actions/ProfActions.js
  8. 5 7
      src/actions/RegisterActions.js
  9. 21 21
      src/actions/types.js
  10. 2 2
      src/api/api.js
  11. 6 6
      src/components/ActionButton.js
  12. 0 23
      src/components/SaveClassButton.js
  13. 24 20
      src/components/Socket.js
  14. 3 3
      src/components/common/Button.js
  15. 3 3
      src/components/common/Card.js
  16. 2 2
      src/components/common/CardSection.js
  17. 4 4
      src/components/common/Confirm.js
  18. 3 3
      src/components/common/ConnectionError.js
  19. 3 3
      src/components/common/Header.js
  20. 3 3
      src/components/common/Input.js
  21. 1 1
      src/components/common/Spinner.js
  22. 1 1
      src/reducers/AuthReducer.js
  23. 9 9
      src/reducers/ClasesReducer.js
  24. 5 4
      src/reducers/CursadaReducer.js
  25. 4 4
      src/reducers/LocalStorageReducer.js
  26. 4 4
      src/reducers/ProfReducer.js
  27. 6 4
      src/reducers/RegisterReducer.js
  28. 41 47
      src/scenes/Clase.js
  29. 39 36
      src/scenes/Clase/Comentarios.js
  30. 7 7
      src/scenes/Clase/Teoria.js
  31. 48 47
      src/scenes/Cursada/ItemCursada.js
  32. 35 37
      src/scenes/LSListaClases.js
  33. 61 59
      src/scenes/ListaClases.js
  34. 15 14
      src/scenes/ListaCursadas.js
  35. 5 5
      src/scenes/Live/Canvas.js
  36. 19 18
      src/scenes/Live/Chat.js
  37. 69 67
      src/scenes/LiveVideo.js
  38. 121 119
      src/scenes/LoginForm.js
  39. 4 6
      src/scenes/Menu.js
  40. 43 36
      src/scenes/MyAbout.js
  41. 36 31
      src/scenes/Profesor.js
  42. 78 79
      src/scenes/RegisterForm.js

+ 3 - 0
package.json

@@ -29,6 +29,9 @@
   "devDependencies": {
     "babel-jest": "17.0.2",
     "babel-preset-react-native": "1.9.0",
+    "eslint-config-rallycoding": "^3.1.0",
+    "eslint-plugin-class-property": "^1.0.1",
+    "eslint-plugin-react": "^6.7.1",
     "jest": "17.0.3",
     "jest-react-native": "17.0.3",
     "react-test-renderer": "15.3.2",

+ 3 - 3
src/App.js

@@ -10,9 +10,9 @@ class App extends Component {
   render() {
     const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
     return (
-        <Provider store={store}>
-  	  	  <Router />
-       </Provider>
+		<Provider store={store}>
+			<Router />
+		</Provider>
     );
   }
 }

+ 23 - 21
src/Router.js

@@ -1,5 +1,4 @@
 import React from 'react';
-import { View, Text } from 'react-native';
 import { Scene, Router, Actions } from 'react-native-router-flux';
 
 import RegisterForm from './scenes/RegisterForm';
@@ -15,33 +14,36 @@ import LSListaClases from './scenes/LSListaClases';
 import MyAbout from './scenes/MyAbout';
 
 const scenes = Actions.create(
-	<Scene key="container">
-
-		<Scene key="auth" hideNavBar={true}>
-			<Scene key="login" component={LoginForm} sceneStyle={{ paddingTop: 0 }} hideNavBar={true} title="Ingresar" initial />
-			<Scene key="register" component={RegisterForm} title="Registrarse" />
+	<Scene key='container'>
+
+		<Scene key='auth' hideNavBar>
+			<Scene
+				key='login' component={LoginForm}
+				sceneStyle={{ paddingTop: 0 }} hideNavBar title='Ingresar' initial
+			/>
+			<Scene key='register' component={RegisterForm} title='Registrarse' />
 		</Scene>
 
-		<Scene key="Menu" hideNavBar={false}>
-			<Scene key="MenuScene" title="Menu" component={Menu} panHandlers={null} direction="vertical" />
-			<Scene key="LSClases" title="Clases descargadas" component={LSListaClases} />
-			<Scene key="Teoria" title="Teoria" component={Teoria} />
-			<Scene key="About" title="Acerca de" component={MyAbout} />
-			<Scene key="ListaCursadas" component={ListaCursadas} title="Cursadas" />
-			<Scene key="ViewCursada" component={ListaClases} title="Clases" />
-			<Scene key="ViewClase" component={Clase} title="Clase" />
-			<Scene key="ViewProf" component={Profesor} title="Profesor" />
-			<Scene key="Live" title="Curso en vivo" component={LiveVideo} />
+		<Scene key='Menu' hideNavBar={false}>
+			<Scene
+				key='MenuScene' title='Menu'
+				component={Menu} panHandlers={null} direction='vertical'
+			/>
+			<Scene key='LSClases' title='Clases descargadas' component={LSListaClases} />
+			<Scene key='Teoria' title='Teoria' component={Teoria} />
+			<Scene key='About' title='Acerca de' component={MyAbout} />
+			<Scene key='ListaCursadas' component={ListaCursadas} title='Cursadas' />
+			<Scene key='ViewCursada' component={ListaClases} title='Clases' />
+			<Scene key='ViewClase' component={Clase} title='Clase' />
+			<Scene key='ViewProf' component={Profesor} title='Profesor' />
+			<Scene key='Live' title='Curso en vivo' component={LiveVideo} />
 		</Scene>
 
 
 	</Scene>
 );
 
-const RouterComponent = () => {
-	return (
-		<Router sceneStyle={{ paddingTop: 55 }} scenes={scenes} />
-	);
-};
+const RouterComponent = () =>
+		<Router sceneStyle={{ paddingTop: 55 }} scenes={scenes} />;
 
 export default RouterComponent;

+ 3 - 3
src/actions/AuthActions.js

@@ -1,5 +1,5 @@
 import { Actions } from 'react-native-router-flux';
-import { post } from '../api/'
+import { post } from '../api/';
 import {
   EMAIL_CHANGED,
   PASSWORD_CHANGED,
@@ -25,7 +25,7 @@ export const passwordChanged = (text) => {
 export const loginUser = ({ email, password }) => {
   return (dispatch) => {
     dispatch({ type: LOGIN_USER });
-    post( "login.php", { user: email, pass: password } )
+    post('login.php', { user: email, pass: password })
       .then(
         (response) => loginUserSuccess(dispatch, response)
       ).catch(
@@ -35,7 +35,7 @@ export const loginUser = ({ email, password }) => {
 };
 
 const loginUserFail = (dispatch, error) => {
-  console.log("login failed", error);
+  console.log('login failed', error);
   dispatch({ type: LOGIN_USER_FAIL, payload: error });
 };
 

+ 27 - 28
src/actions/CursadaActions.js

@@ -1,5 +1,4 @@
-import { Actions } from 'react-native-router-flux';
-import { post } from '../api/'
+import { post } from '../api/';
 
 import {
 	CURSADAS_FETCH_SUCCESS,
@@ -15,47 +14,47 @@ export const cursadasFetch = () => {
 	return (dispatch) => {
 		const path = 'listaCursos.php';
 		post(path, { cursadas: 1 })
-		  .then( (response) => {
+		.then((response) => {
 			dispatch({
-			  type: CURSADAS_FETCH_SUCCESS,
-			  payload: response
+				type: CURSADAS_FETCH_SUCCESS,
+				payload: response
 			});
-		  })
-		.catch( (error) => {
-			dispatch({ type: CURSADAS_FETCH_FAIL })
+		})
+		.catch((error) => {
+			dispatch({ type: CURSADAS_FETCH_FAIL, payload: error });
 		});
 	};
 };
 
-export const cursadaFetch = ({_id}) => {
+export const cursadaFetch = ({ _id }) => {
 	return (dispatch) => {
 		const path = 'getCourse.php';
-		post(path,{ id: _id })
-		  .then( (response) => {
+		post(path, { id: _id })
+		.then((response) => {
 			dispatch({
-		  		type: CURSADA_FETCH_SUCCESS,
-		  		payload: response
+				type: CURSADA_FETCH_SUCCESS,
+				payload: response
 			});
-		  })
-		  .catch( (error) => {
-		  	dispatch({ type: CURSADA_FETCH_FAIL });
-		  });
+		})
+		.catch((error) => {
+			dispatch({ type: CURSADA_FETCH_FAIL, payload: error });
+		});
 	};
 };
 
-export const claseFetch = ({cursada, _id}) => {
+export const claseFetch = ({ cursada, _id }) => {
 	return (dispatch) => {
-		dispatch({type: CLASE_FETCH});
+		dispatch({ type: CLASE_FETCH });
 		const path = 'getClase.php';
-	  	post(path, { cursada, id: _id })
-	  		.then( (response) => {
-				dispatch({
-				  type: CLASE_FETCH_SUCCESS,
-				  payload: response
-				});
-	  		})
-			.catch( (error) => {
-				dispatch({ type: CLASE_FETCH_FAIL });
+		post(path, { cursada, id: _id })
+		.then((response) => {
+			dispatch({
+				type: CLASE_FETCH_SUCCESS,
+				payload: response
 			});
+		})
+		.catch((error) => {
+			dispatch({ type: CLASE_FETCH_FAIL, payload: error });
+		});
 	};
 };

+ 18 - 16
src/actions/LocalStorageActions.js

@@ -4,12 +4,12 @@ import {
   LS_CLASE_INIT
 } from './types';
 
-var ls = require('react-native-local-storage');
+const ls = require('react-native-local-storage');
 
-export const saveClase = ({clase}) => {
+export const saveClase = ({ clase }) => {
 	//_id, profesor, texto, titulo, fecha
 	return (dispatch) => {
-		ls.get('clases').then( (data) => {
+		ls.get('clases').then((data) => {
 			ls.save('clases', [...data, clase]).then(() => {
 				dispatch({
 					type: LS_CLASE_SAVE,
@@ -18,34 +18,36 @@ export const saveClase = ({clase}) => {
 			});
 		});
 	};
-}
+};
 
-export const deleteClase = ({clase}) => {
+export const deleteClase = ({ clase }) => {
 	return (dispatch) => {
-		ls.get('clases').then( (data) => {
-			const filtered = data.filter( c => {
-				return c._id !== clase._id
+		ls.get('clases').then((data) => {
+			const filtered = data.filter(c => {
+				return c._id !== clase._id;
 			});
-			ls.save('clases', filtered ).then(() => {
+			ls.save('clases', filtered).then(() => {
 				dispatch({
 					type: LS_CLASE_DELETE,
 					payload: clase._id
 				});
 			});
 		});
-	}
-}
+	};
+};
 
 export const initLSClase = () => {
 	return (dispatch) => {
-		ls.get('clases').then( (data) => {
-			if (data===null || data===undefined)
-				data = [];
+		ls.get('clases').then((data) => {
+			let payload = data;
+			if (data === null || data === undefined) {
+				payload = [];
+			}
 
 			dispatch({
 				type: LS_CLASE_INIT,
-				payload: data
+				payload
 			});
 		});
 	};
-}
+};

+ 24 - 24
src/actions/ProfActions.js

@@ -1,29 +1,29 @@
 import {
-  PROFESOR_FETCH_SUCCESS,
-  PROFESOR_FETCH
+	PROFESOR_FETCH_SUCCESS,
+	PROFESOR_FETCH
 } from './types';
 
-export const profFetch = ({id}) => {
-  return (dispatch) => {
-    dispatch({
-      type: PROFESOR_FETCH,
-    });
+export const profFetch = ({ id }) => {
+	return (dispatch) => {
+		dispatch({
+			type: PROFESOR_FETCH,
+		});
 
-    fetch('https://plataforma.especificosba.com.ar/back/getProfesor.php', {
-      method: 'POST',
-      headers: {
-          'Accept': 'application/json',
-          'Content-Type': 'application/json',
-      },
-      body: JSON.stringify({ id })
-    })
-    .then( (response) => response.json() )
-      .then( (responseJson) => {
-        console.log("prof response", responseJson);
-        dispatch({
-          type: PROFESOR_FETCH_SUCCESS,
-          payload: responseJson
-        });
-      });
-  };
+		fetch('https://plataforma.especificosba.com.ar/back/getProfesor.php', {
+			method: 'POST',
+			headers: {
+				'Accept': 'application/json',
+				'Content-Type': 'application/json',
+			},
+			body: JSON.stringify({ id })
+		})
+		.then((response) => response.json())
+		.then((responseJson) => {
+			console.log('prof response', responseJson);
+			dispatch({
+				type: PROFESOR_FETCH_SUCCESS,
+				payload: responseJson
+			});
+		});
+	};
 };

+ 5 - 7
src/actions/RegisterActions.js

@@ -1,4 +1,3 @@
-import { Actions } from 'react-native-router-flux';
 import {
   PROP_CHANGED,
   REGISTER_USER,
@@ -6,18 +5,18 @@ import {
   REGISTER_USER_FAILURE
 } from './types';
 
-export const propChanged = ({key,val}) => {
+export const propChanged = ({ key, val }) => {
   return {
     type: PROP_CHANGED,
-    payload: {key,val}
+    payload: { key, val }
   };
 };
 
 
-export const registerUser = ( ) => {
-  console.log("registering");
+export const registerUser = () => {
+  console.log('registering');
   return (dispatch) => {
-    dispatch({ type: REGISTER_USER })
+    dispatch({ type: REGISTER_USER });
     /*fetch('https://plataforma.especificosba.com.ar/back/login.php', {
       method: 'POST',
       headers: {
@@ -35,5 +34,4 @@ export const registerUser = ( ) => {
       });
     */
   };
-
 };

+ 21 - 21
src/actions/types.js

@@ -1,28 +1,28 @@
-export const EMAIL_CHANGED = "email_changed";
-export const PASSWORD_CHANGED = "password_changed";
+export const EMAIL_CHANGED = 'email_changed';
+export const PASSWORD_CHANGED = 'password_changed';
 
-export const LOGIN_USER_SUCCESS = "login_user_success";
-export const LOGIN_USER_FAIL = "login_user_fail";
-export const LOGIN_USER = "login_user";
+export const LOGIN_USER_SUCCESS = 'login_user_success';
+export const LOGIN_USER_FAIL = 'login_user_fail';
+export const LOGIN_USER = 'login_user';
 
-export const CURSADA_FETCH_SUCCESS = "cursada_fetch_success";
-export const CURSADA_FETCH_FAIL = "cursada_fetch_fail";
+export const CURSADA_FETCH_SUCCESS = 'cursada_fetch_success';
+export const CURSADA_FETCH_FAIL = 'cursada_fetch_fail';
 
-export const CURSADAS_FETCH_FAIL = "cursadas_fetch_fail";
-export const CURSADAS_FETCH_SUCCESS = "cursadas_fetch_success";
+export const CURSADAS_FETCH_FAIL = 'cursadas_fetch_fail';
+export const CURSADAS_FETCH_SUCCESS = 'cursadas_fetch_success';
 
-export const CLASE_FETCH_FAIL = "clase_fetch_fail";
-export const CLASE_FETCH_SUCCESS = "clase_fetch_success";
-export const CLASE_FETCH = "clase_fetch";
+export const CLASE_FETCH_FAIL = 'clase_fetch_fail';
+export const CLASE_FETCH_SUCCESS = 'clase_fetch_success';
+export const CLASE_FETCH = 'clase_fetch';
 
-export const PROFESOR_FETCH = "profesor_fetch";
-export const PROFESOR_FETCH_SUCCESS = "profesor_fetch_success";
+export const PROFESOR_FETCH = 'profesor_fetch';
+export const PROFESOR_FETCH_SUCCESS = 'profesor_fetch_success';
 
-export const PROP_CHANGED = "prop_changed";
-export const REGISTER_USER = "register_user";
-export const REGISTER_USER_SUCCESS = "register_user_success";
-export const REGISTER_USER_FAILURE = "register_user_failure";
+export const PROP_CHANGED = 'prop_changed';
+export const REGISTER_USER = 'register_user';
+export const REGISTER_USER_SUCCESS = 'register_user_success';
+export const REGISTER_USER_FAILURE = 'register_user_failure';
 
-export const LS_CLASE_SAVE = "clase_save";
-export const LS_CLASE_DELETE = "clase_delete";
-export const LS_CLASE_INIT = "clase_init";
+export const LS_CLASE_SAVE = 'clase_save';
+export const LS_CLASE_DELETE = 'clase_delete';
+export const LS_CLASE_INIT = 'clase_init';

+ 2 - 2
src/api/api.js

@@ -19,7 +19,7 @@ export async function post(path, data) {
       return Promise.reject(json.error);
 
   } catch(error) {
-    //console.log("rejecting", path);
-    return Promise.reject("Error indefinido");
+    //console.log('rejecting', path);
+    return Promise.reject('Error indefinido');
   }
 }

+ 6 - 6
src/components/ActionButton.js

@@ -1,17 +1,17 @@
 import React from 'react';
 import ActionButton from 'react-native-action-button';
-import Icon from 'react-native-vector-icons/Ionicons';
-import { Actions, ActionConst } from 'react-native-router-flux';
+import { Actions } from 'react-native-router-flux';
 
 const MyActionButton = (props) => {
 	const { children, onPress } = props;
 	return (
 		<ActionButton
-		  	buttonColor="rgba(231,76,60,1)"
-        	onPress={ onPress || (() => Actions.Menu()) }>
-			{children}
+		buttonColor='rgba(231, 76, 60, 1)'
+		onPress={onPress || (() => Actions.Menu())}
+		>
+		{ children}
 		</ActionButton>
 	);
-}
+};
 
 export default MyActionButton;

+ 0 - 23
src/components/SaveClassButton.js

@@ -1,23 +0,0 @@
-import React from 'react';
-import ActionButton from 'react-native-action-button';
-import Icon from 'react-native-vector-icons/Ionicons';
-import { Actions, ActionConst } from 'react-native-router-flux';
-
-const SaveClassButton = (props) => {
-	const { children, onPress } = props;
-	return (
-		<ActionButton.Item onPress={() => {} } buttonColor='#ee22ee'>
-            <Icon name="md-cloud-download" style={styles.actionButtonIcon} />
-		</ActionButton.Item>
-	);
-}
-
-const styles = {
-	actionButtonIcon: {
-	  fontSize: 20,
-	  height: 22,
-	  color: 'white',
-	}
-}
-
-export default SaveClassButton;

+ 24 - 20
src/components/Socket.js

@@ -2,48 +2,52 @@ import React, { Component } from 'react';
 import { View } from 'react-native';
 
 
-class Socket extends Component  {
-	getTime() {
-		var d = new Date();
-		var curr_hour = d.getHours();
-		var curr_min = d.getMinutes();
-		if (curr_min < 10)
-			curr_min='0'+curr_min;
-		return curr_hour+":"+curr_min;
-	}
-
+class Socket extends Component {
 	componentDidMount() {
-		this.ws = new WebSocket('wss://plataforma.especificosba.com.ar/ws/')
+		this.ws = new WebSocket('wss://plataforma.especificosba.com.ar/ws/');
 		this.ws.onopen = () => {
-			console.log("ws open");
+			console.log('ws open');
 		};
 		this.ws.onmessage = (e) => {
 			const msg = JSON.parse(e.data);
 			console.log(msg);
-			switch(msg.type){
-				case "diapo":
+			switch (msg.type) {
+				case 'diapo':
 					this.props.onDiapoChanged(msg.PDF, msg.slide);
 					return;
-				case "chat":
+				case 'chat':
 					this.props.onMessage(msg.user, msg.text);
 					return;
+				default:
+					return;
 			}
 		};
 		this.ws.onerror = (e) => {
 			console.log(e.message);
-		}
+		};
+
 		this.ws.onclose = (e) => {
 			console.log(e.code, e.reason);
-		}
-	};
+		};
+	}
+
 	componentWillUnmount() {
 		this.ws.onmessage = () => {};
 		this.ws.close();
-	};
+	}
 
+	getTime() {
+		const d = new Date();
+		const currHour = d.getHours();
+		let currMin = d.getMinutes();
+		if (currMin < 10) {
+			currMin = `0${currMin}`;
+		}
+		return `${currHour}:${currMin}`;
+	}
 	render() {
 		return <View />;
 	}
-};
+}
 
 export default Socket;

+ 3 - 3
src/components/common/Button.js

@@ -7,7 +7,7 @@ const Button = (props) => {
   return (
     <TouchableOpacity onPress={onPress} style={buttonStyle}>
       <Text style={textStyle}>
-        {children}
+        { children}
       </Text>
     </TouchableOpacity>
   );
@@ -17,7 +17,7 @@ const styles = {
   textStyle: {
     alignSelf: 'center',
     color: '#F1F2F2',
-    fontSize:16,
+    fontSize: 16,
     fontWeight: '600',
     paddingTop: 5,
     paddingBottom: 5
@@ -35,4 +35,4 @@ const styles = {
     marginBottom: 10
   }
 };
-export {Button};
+export { Button};

+ 3 - 3
src/components/common/Card.js

@@ -4,7 +4,7 @@ import { Text, View } from 'react-native';
 const Card = (props) => {
   return (
     <View style={styles.containerStyle}>
-      {props.children}
+      { props.children}
     </View>
   );
 
@@ -17,7 +17,7 @@ const styles = {
     borderColor: '#ddd',
     borderBottomWidth: 0,
     shadowColor: '#000',
-    shadowOffset: { width: 0, height: 2},
+    shadowOffset: { width: 0, height: 2 },
     shadowOpacity: 0.1,
     shadowRadius: 2,
     elevation: 1,
@@ -26,4 +26,4 @@ const styles = {
     marginTop: 10
   }
 };
-export {Card};
+export { Card};

+ 2 - 2
src/components/common/CardSection.js

@@ -4,7 +4,7 @@ import { View } from 'react-native';
 const CardSection = (props) => {
   return (
     <View style={[styles.containerStyle, props.style]}>
-      {props.children}
+      { props.children}
     </View>
   );
 };
@@ -20,4 +20,4 @@ const styles = {
     position: 'relative'
   }
 };
-export {CardSection};
+export { CardSection};

+ 4 - 4
src/components/common/Confirm.js

@@ -7,14 +7,14 @@ const Confirm = ({ children, visible, onAccept, onDecline }) => {
   return (
     <Modal
       transparent
-      animationType="slide"
+      animationType='slide'
       visible={visible}
-      onRequestClose={ () => {}}
+      onRequestClose={() => {}}
     >
       <View style={styles.containerStyle}>
         <CardSection style={styles.cardSectionStyle}>
           <Text style={styles.textStyle}>
-            {children}
+            { children}
           </Text>
         </CardSection>
 
@@ -29,7 +29,7 @@ const Confirm = ({ children, visible, onAccept, onDecline }) => {
 
 const styles = {
   containerStyle: {
-    backgroundColor: 'rgba(0,0,0,0.75)',
+    backgroundColor: 'rgba(0, 0, 0, 0.75)',
     position: 'relative',
     flex: 1,
     justifyContent: 'center'

+ 3 - 3
src/components/common/ConnectionError.js

@@ -3,9 +3,9 @@ import { View, Text, ListView } from 'react-native';
 
 const ConnectionError = () => {
 	return (
-		<View style={{padding:15,justifyContent:'center',backgroundColor:'red'}}>
-			<Text style={{fontSize:25,color:'white',alignSelf:'center'}}>Error en la conexión</Text>
-			<Text style={{fontSize:15,color:'white',alignSelf:'center'}}>Hubo un problema conectandose al servidor. Por favor revise su conexión y vuelva a intentar.</Text>
+		<View style={{ padding: 15, justifyContent: 'center', backgroundColor: 'red' }}>
+			<Text style={{ fontSize: 25, color: 'white', alignSelf: 'center' }}>Error en la conexión</Text>
+			<Text style={{ fontSize: 15, color: 'white', alignSelf: 'center' }}>Hubo un problema conectandose al servidor. Por favor revise su conexión y vuelva a intentar.</Text>
 		</View>
 	);
 };

+ 3 - 3
src/components/common/Header.js

@@ -5,7 +5,7 @@ const Header = (props) => {
 	const { textStyle, viewStyle } = styles;
 	return (
 	<View style={viewStyle}>
-		<Text style={textStyle}>{props.headerText}</Text>
+		<Text style={textStyle}>{ props.headerText}</Text>
 	</View>
 	);
 };
@@ -17,7 +17,7 @@ const styles = {
 		alignItems: 'center',
 		height: 60,
 		shadowColor: '#000',
-		shadowOffset: { width: 0, height: 2},
+		shadowOffset: { width: 0, height: 2 },
 		shadowOpacity: 0.2,
 		elevation: 2,
 		position: 'relative'
@@ -26,4 +26,4 @@ const styles = {
 		fontSize: 20
 	}
 };
-export  {Header};
+export  { Header};

+ 3 - 3
src/components/common/Input.js

@@ -1,11 +1,11 @@
 import React from 'react';
 import { View, TextInput, Text } from 'react-native';
 
-const Input = ({label, value, onChangeText, placeholder, secureTextEntry}) => {
+const Input = ({ label, value, onChangeText, placeholder, secureTextEntry}) => {
 	const  { InputStyle, LabelStyle, ContainerStyle } = styles;
 	return (
 		<View style={ContainerStyle}>
-			<Text style={LabelStyle}> {label} </Text>
+			<Text style={LabelStyle}> { label} </Text>
 			<TextInput
 				autoCorrect={false}
 				secureTextEntry={secureTextEntry}
@@ -20,7 +20,7 @@ const Input = ({label, value, onChangeText, placeholder, secureTextEntry}) => {
 
 const styles = {
 	InputStyle: {
-		color: "#000",
+		color: '#000',
 		paddingRight: 5,
 		paddingLeft: 5,
 		fontSize: 18,

+ 1 - 1
src/components/common/Spinner.js

@@ -4,7 +4,7 @@ import { View, ActivityIndicator } from 'react-native';
 const Spinner = ( props ) => {
 	return (
 		<View style={[styles.spinnerStyle, props.style]}>
-			<ActivityIndicator size={props.size || 'large'} />
+			<ActivityIndicator size={props.size || 'large' } />
 		</View>
 	);
 };

+ 1 - 1
src/reducers/AuthReducer.js

@@ -15,7 +15,7 @@ const INITIAL_STATE = {
 };
 
 export default (state = INITIAL_STATE, action) => {
-  switch(action.type) {
+  switch (action.type) {
     case EMAIL_CHANGED:
       return { ...state, email: action.payload };
     case PASSWORD_CHANGED:

+ 9 - 9
src/reducers/ClasesReducer.js

@@ -11,14 +11,14 @@ const INITIAL_STATE = {
 };
 
 export default (state = INITIAL_STATE, action) => {
-  switch(action.type) {
-	case CLASE_FETCH:
-	  return { ...state, loading: true };
-    case CLASE_FETCH_SUCCESS:
-      return { ...state, loading: false, curClase: action.payload };
-	case CLASE_FETCH_FAIL:
-	  return { ...state, loading: false, curClase: { error: true } };
-    default:
-      return state;
+	switch (action.type) {
+		case CLASE_FETCH:
+		return { ...state, loading: true };
+		case CLASE_FETCH_SUCCESS:
+		return { ...state, loading: false, curClase: action.payload };
+		case CLASE_FETCH_FAIL:
+		return { ...state, loading: false, curClase: { error: true } };
+		default:
+		return state;
   }
 };

+ 5 - 4
src/reducers/CursadaReducer.js

@@ -14,10 +14,11 @@ const INITIAL_STATE = {
 };
 
 export default (state = INITIAL_STATE, action) => {
-  switch(action.type) {
-    case CURSADAS_FETCH_SUCCESS:
-      const { cursadas, cursos } = action.payload;
-      return { ...state, cursadas, cursos, error: false };
+	switch (action.type) {
+		case CURSADAS_FETCH_SUCCESS: {
+			const { cursadas, cursos } = action.payload;
+			return { ...state, cursadas, cursos, error: false };
+		}
     case CURSADAS_FETCH_FAIL:
       return { ...state, error: true };
     case CURSADA_FETCH_SUCCESS:

+ 4 - 4
src/reducers/LocalStorageReducer.js

@@ -9,15 +9,15 @@ const INITIAL_STATE = {
 };
 
 export default (state = INITIAL_STATE, action) => {
-	switch(action.type) {
+	switch (action.type) {
 		case LS_CLASE_SAVE:
 			//payload === clase
-			return { ...state, clases: [ ...state.clases, action.payload ] } ;
+			return { ...state, clases: [...state.clases, action.payload] };
 		case LS_CLASE_DELETE:
 			//payload === clase._id
-			return { ...state, clases: state.clases.filter( c => { return c._id !== action.payload } ) };
+			return { ...state, clases: state.clases.filter(c => c._id !== action.payload) };
 		case LS_CLASE_INIT:
-			console.log("clases init value:", action.payload);
+			console.log('clases init value: ', action.payload);
 			return { clases: action.payload };
 		default:
 			return state;

+ 4 - 4
src/reducers/ProfReducer.js

@@ -6,11 +6,11 @@ import {
 const INITIAL_STATE = { profesor: {} };
 
 export default (state = INITIAL_STATE, action) => {
-  switch(action.type) {
-  	case PROFESOR_FETCH:
-	  return INITIAL_STATE;
+	switch (action.type) {
+	case PROFESOR_FETCH:
+		return INITIAL_STATE;
     case PROFESOR_FETCH_SUCCESS:
-      return { ...state, profesor: action.payload };
+		return { ...state, profesor: action.payload };
     default:
       return state;
   }

+ 6 - 4
src/reducers/RegisterReducer.js

@@ -22,14 +22,16 @@ const INITIAL_STATE = {
 };
 
 export default (state = INITIAL_STATE, action) => {
-  switch(action.type) {
-    case PROP_CHANGED:
+  switch (action.type) {
+    case PROP_CHANGED: {
       const { key, val } = action.payload;
       const newUser = { ...state.user, [key]: val };
       return { ...state, user: newUser };
-    case REGISTER_USER:
-      console.log("setting loading");
+	}
+    case REGISTER_USER: {
+      console.log('setting loading');
       return { ...state, loading: true };
+	}
     default:
       return state;
   }

+ 41 - 47
src/scenes/Clase.js

@@ -1,20 +1,16 @@
 import React, { Component } from 'react';
-import { View, Text } from 'react-native';
+import { View } from 'react-native';
 import { connect } from 'react-redux';
-import Tabs from 'react-native-tabs';
 import Icon from 'react-native-vector-icons/Ionicons';
 import ActionButton from 'react-native-action-button';
-import { Actions, ActionConst } from 'react-native-router-flux';
+import { Actions } from 'react-native-router-flux';
 
 
 import { claseFetch, saveClase, deleteClase } from '../actions/';
 import Teoria from './Clase/Teoria';
 import Comentarios from './Clase/Comentarios';
-import { Spinner } from '../components/common/';
+import { Spinner, ConnectionError } from '../components/common/';
 import MyActionButton from '../components/ActionButton';
-import SaveClassButton from '../components/SaveClassButton';
-import { ConnectionError } from '../components/common';
-
 
 class Clase extends Component {
 	state = { page: 'Teoria' };
@@ -23,66 +19,64 @@ class Clase extends Component {
 		this.props.claseFetch(this.props);
 	}
 
-	renderView() {
-		if ( this.state.page === 'Teoria' )
-			return <Teoria titulo={titulo} profesor={profesor} texto={texto} style={{flex:1}} />;
-
-		if ( this.state.page === 'Comentarios' )
-			return <Comentarios style={{flex:1}} comentarios={comentarios} respuestas={respuestas} />;
-
-		return <Text>{this.state.page}!!!</Text>;
-	}
 	onSavePress() {
 		const { local, clase } = this.props;
-		if ( !local ) {
+		if (!local) {
 			this.props.saveClase({ clase });
 			return;
 		}
 		this.props.deleteClase({ clase });
 	}
-
 	render() {
 		const { clase, local, loading } = this.props;
 
-		if (loading)
-			return <Spinner size="large" />;
+		if (loading) {
+			return <Spinner size='large' />;
+		}
 
-		if (clase.error)
+		if (clase.error) {
 			return <ConnectionError />;
+		}
+
+		const ScrollableTabView = require('react-native-scrollable-tab-view');
 
-		var ScrollableTabView = require('react-native-scrollable-tab-view');
 		const { titulo, profesor, texto, comentarios, respuestas } = this.props.clase;
 
-		const icon = local ? "ios-star" : "ios-star-outline";
-		const title = local ? "Borrar clase" : "Guardar clase";
+		const icon = local ? 'ios-star' : 'ios-star-outline';
+		const title = local ? 'Borrar clase' : 'Guardar clase';
 
 		return (
-			<View style={{flex:1}}>
-
-				<ScrollableTabView style={styles.container, {flex:1}}>
-					<Teoria titulo={titulo} profesor={profesor} texto={texto} style={{flex:1}} tabLabel="Teoria" />
-					<View tabLabel="Videos" />
-					<Comentarios style={{flex:1}} comentarios={comentarios} respuestas={respuestas} tabLabel="Comentarios" />
-				</ScrollableTabView>
-
-				<MyActionButton onPress={() => true}>
-					<ActionButton.Item buttonColor='#22eeee' title="Comentario">
-						<Icon name="md-create" style={styles.actionButtonIcon} />
-					</ActionButton.Item>
-
-					<ActionButton.Item onPress={this.onSavePress.bind(this)} buttonColor='#ee22ee' title={title}>
-						<Icon name={ icon } style={styles.actionButtonIcon} />
-					</ActionButton.Item>
-
-					<ActionButton.Item onPress={() => Actions.Menu()} buttonColor='#eeee22' title="Menu">
-						<Icon name="md-apps" style={styles.actionButtonIcon} />
-					</ActionButton.Item>
-				</MyActionButton>
+			<View style={{ flex: 1 }}>
+
+			<ScrollableTabView style={[styles.container, { flex: 1 }]}>
+				<Teoria
+					titulo={titulo} profesor={profesor} texto={texto} style={{ flex: 1 }} tabLabel='Teoria'
+				/>
+				<View tabLabel='Videos' />
+				<Comentarios
+					style={{ flex: 1 }} comentarios={comentarios}
+					respuestas={respuestas} tabLabel='Comentarios'
+				/>
+			</ScrollableTabView>
+
+			<MyActionButton onPress={() => true}>
+			<ActionButton.Item buttonColor='#22eeee' title='Comentario'>
+				<Icon name='md-create' style={styles.actionButtonIcon} />
+			</ActionButton.Item>
+
+			<ActionButton.Item onPress={this.onSavePress.bind(this)} buttonColor='#ee22ee' title={title}>
+				<Icon name={icon} style={styles.actionButtonIcon} />
+			</ActionButton.Item>
+
+			<ActionButton.Item onPress={() => Actions.Menu()} buttonColor='#eeee22' title='Menu'>
+				<Icon name='md-apps' style={styles.actionButtonIcon} />
+			</ActionButton.Item>
+			</MyActionButton>
 
 			</View>
 		);
 	}
-};
+}
 
 const styles = {
 	actionButtonIcon: {
@@ -102,7 +96,7 @@ const mapStateToProps = state => {
 	const { curClase, loading } = state.ClasesReducer;
 	const localClases = state.LocalStorageReducer.clases;
 
-	const local = localClases.filter( c => {
+	const local = localClases.filter(c => {
 		return c._id === curClase._id
 	}).length > 0;
 

+ 39 - 36
src/scenes/Clase/Comentarios.js

@@ -1,6 +1,5 @@
 import React, { Component } from 'react';
-import { Text, ListView, View, TouchableOpacity, Image, TextInput } from 'react-native';
-import { Actions } from 'react-native-router-flux';
+import { Text, ListView, View, Image, TextInput } from 'react-native';
 import { Card, CardSection, Button } from '../../components/common';
 
 class Comentarios extends Component {
@@ -13,16 +12,17 @@ class Comentarios extends Component {
 		this.createDataSource(nextProps);
 	}
 
-  createDataSource({comentarios, respuestas}){
+  createDataSource({ comentarios, respuestas }) {
     const ds = new ListView.DataSource({
-      rowHasChanged: (r1,r2) => r1 !== r2
+      rowHasChanged: (r1, r2) => r1 !== r2
     });
 
-    let c = comentarios.map(function(el) {
-      el.respuestas = respuestas.filter(function(r){
-        return (r.parent == el._id);
-      })
-      return el;
+    const c = comentarios.map(el => {
+		const ret = el;
+		ret.respuestas = respuestas.filter(r => {
+			return (r.parent === el._id);
+		});
+      return ret;
     });
     console.log(c);
     this.dataSource = ds.cloneWithRows(c);
@@ -32,18 +32,21 @@ class Comentarios extends Component {
     return `https://plataforma.especificosba.com.ar/images/perfiles/${id}.jpg`;
   }
 
-  renderRespuesta(item, key) {
+  renderRespuesta(item) {
     return (
-      <View key={item._id} style={{flex:1}}>
-        <View style={{flexDirection: 'row'}}>
-          <Image resizeMode='contain' source={{ uri: this.imageUri(item.userid) }} style={{flex:1, height:40}}/>
-          <View style={{flex:2, justifyContent: 'center', alignItems:'center'}}>
+      <View key={item._id} style={{ flex: 1 }}>
+        <View style={{ flexDirection: 'row' }}>
+		<Image
+			resizeMode='contain' source={{ uri: this.imageUri(item.userid) }}
+			style={{ flex: 1, height: 40 }}
+		/>
+          <View style={{ flex: 2, justifyContent: 'center', alignItems: 'center' }}>
             <Text>{item.nombreUsuario}</Text>
             <Text>{item.fecha}</Text>
           </View>
         </View>
-        <CardSection style={{backgroundColor:'#eef'}}>
-          <Text style={{color:'#000'}}>{item.texto}</Text>
+        <CardSection style={{ backgroundColor: '#eef' }}>
+          <Text style={{ color: '#000' }}>{item.texto}</Text>
         </CardSection>
       </View>
     );
@@ -52,29 +55,29 @@ class Comentarios extends Component {
   renderComentario(item) {
     const uri = this.imageUri(item.userid);
 
-    let Arr = item.respuestas.map( el => {
+    let Arr = item.respuestas.map(el => {
       return this.renderRespuesta(el);
     });
-    if ( Arr != undefined && Arr.length > 0 ) {
-      Arr = <View style={{backgroundColor:'#eef'}}>{Arr}</View>;
+    if (Arr !== undefined && Arr.length > 0) {
+      Arr = <View style={{ backgroundColor: '#eef' }}>{ Arr}</View>;
     }
 
     return (
       <Card>
 
         <CardSection>
-          <Image resizeMode='contain' source={{ uri }} style={{flex:1, height:70}}/>
-          <View style={{flex:2, justifyContent: 'center', alignItems:'center'}}>
-            <Text style={{alignSelf:'center'}}>{item.nombreUsuario}</Text>
-            <Text style={{alignSelf:'center'}}>{item.fecha}</Text>
+          <Image resizeMode='contain' source={{ uri }} style={{ flex: 1, height: 70 }} />
+          <View style={{ flex: 2, justifyContent: 'center', alignItems: 'center' }}>
+            <Text style={{ alignSelf: 'center' }}>{ item.nombreUsuario}</Text>
+            <Text style={{ alignSelf: 'center' }}>{ item.fecha}</Text>
           </View>
         </CardSection>
 
         <CardSection>
-          <Text>{item.texto}</Text>
+          <Text>{ item.texto}</Text>
         </CardSection>
 
-        {Arr}
+        { Arr}
       </Card>
     );
   }
@@ -83,15 +86,15 @@ class Comentarios extends Component {
     return (
       <Card>
         <CardSection>
-          <Text style={{justifyContent:'center'}}>
+          <Text style={{ justifyContent: 'center' }}>
             Dejar un comentario
           </Text>
         </CardSection>
         <CardSection>
           <TextInput
-            autoCorrect={true}
-            multiline={true}
-            style={{flex:1}}
+            autoCorrect
+            multiline
+            style={{ flex: 1 }}
           />
         </CardSection>
         <CardSection>
@@ -102,11 +105,11 @@ class Comentarios extends Component {
   }
   render() {
     if (this.props.comentarios === undefined ||
-        this.props.comentarios.length == 0 ) {
+        this.props.comentarios.length === 0) {
           return (
-            <View style={{margin:10}}>
-              {this.renderNewComment()}
-              <Text style={{fontSize:14,alignSelf:'center'}}>
+            <View style={{ margin: 10 }}>
+              { this.renderNewComment()}
+              <Text style={{ fontSize: 14, alignSelf: 'center' }}>
                 Aún no hay comentarios
               </Text>
             </View>
@@ -114,13 +117,13 @@ class Comentarios extends Component {
     }
 
     return (
-          <ListView
+		<ListView
             enableEmptySections
             renderHeader={this.renderNewComment}
             dataSource={this.dataSource}
             renderRow={this.renderComentario.bind(this)}
-            />
-		);
+		/>
+	);
   }
 
 }

+ 7 - 7
src/scenes/Clase/Teoria.js

@@ -5,27 +5,27 @@ import { Card, CardSection, Button } from '../../components/common';
 
 class Teoria extends Component {
 	render() {
-		//console.log("teoria", this.props);
+		//console.log('teoria', this.props);
 		return (
-			<View style={{flex:1}}>
+			<View style={{ flex: 1 }}>
 		        <CardSection>
-		          <Text>{this.props.titulo}</Text>
+		          <Text>{ this.props.titulo}</Text>
 		        </CardSection>
 
 		        <CardSection>
 					<TouchableOpacity onPress={() => Actions.ViewProf({ id: this.props.profesor._id})}>
 						<Text>Profesor: </Text>
-						<Text style={{ color: '#007aff', fontWeight: '600'}}>
-							{this.props.profesor.nombre} {this.props.profesor.apellido}
+						<Text style={{ color: '#007aff', fontWeight: '600' }}>
+							{ this.props.profesor.nombre} { this.props.profesor.apellido}
 						</Text>
 					</TouchableOpacity>
 		        </CardSection>
 
-		        <CardSection style={{flex:1, alignItems:'stretch'}}>
+		        <CardSection style={{ flex: 1, alignItems: 'stretch' }}>
 		            <WebView
 		              scalesPageToFit={true}
 		              javaScriptEnabled={false}
-		              source={{html: this.props.texto}} />
+		              source={{ html: this.props.texto}} />
 		        </CardSection>
 			</View>
 		);

+ 48 - 47
src/scenes/Cursada/ItemCursada.js

@@ -5,56 +5,57 @@ import { Button, Card, CardSection } from '../../components/common';
 
 
 class ItemCursada extends Component {
-  onRowPress(){
-    Actions.ViewCursada( { _id: this.props.data._id } );
-  }
-
-  render() {
-    var moment = require('moment');
-    const { data } = this.props;
-    const horaIni = moment(data.horaIni).local().format('HH:mm');
-    const horaFin = moment(data.horaFin).local().format('HH:mm');
-    return (
-      <ScrollView>
-        <Card>
-          <CardSection>
-            <Text style={styles.titleStyle}>
-              {data.titulo}
-            </Text>
-          </CardSection>
-
-          <CardSection style={{flexDirection: 'column'}}>
-            <View>
-              <Text>{data.descCorta}</Text>
-            </View>
-            <View>
-              <Text style={{fontWeight:'700'}}>Mas info</Text>
-            </View>
-          </CardSection>
-
-          <CardSection>
-            <Text style={{flex:1}}>{data.dia}</Text>
-            <Text style={{flex:2}}>{horaIni} a {horaFin}</Text>
-          </CardSection>
-
-          <CardSection>
-            <Button onPress={this.onRowPress.bind(this)}>
-              Ingresar
-            </Button>
-          </CardSection>
-        </Card>
-      </ScrollView>
-    );
-  }
+	onRowPress() {
+		Actions.ViewCursada({ _id: this.props.data._id });
+	}
+
+	render() {
+		const moment = require('moment');
+
+		const { data } = this.props;
+		const horaIni = moment(data.horaIni).local().format('HH:mm');
+		const horaFin = moment(data.horaFin).local().format('HH:mm');
+		return (
+			<ScrollView>
+			<Card>
+			<CardSection>
+			<Text style={styles.titleStyle}>
+			{ data.titulo}
+			</Text>
+			</CardSection>
+
+			<CardSection style={{ flexDirection: 'column' }}>
+			<View>
+			<Text>{ data.descCorta}</Text>
+			</View>
+			<View>
+			<Text style={{ fontWeight: '700' }}>Mas info</Text>
+			</View>
+			</CardSection>
+
+			<CardSection>
+			<Text style={{ flex: 1 }}>{ data.dia}</Text>
+			<Text style={{ flex: 2 }}>{ horaIni} a { horaFin}</Text>
+			</CardSection>
+
+			<CardSection>
+			<Button onPress={this.onRowPress.bind(this)}>
+			Ingresar
+			</Button>
+			</CardSection>
+			</Card>
+			</ScrollView>
+		);
+	}
 }
 
 const styles = {
-  titleStyle: {
-    fontSize: 18,
-    paddingLeft: 15,
-    textAlign: 'center',
-    flex: 1
-  }
+	titleStyle: {
+		fontSize: 18,
+		paddingLeft: 15,
+		textAlign: 'center',
+		flex: 1
+	}
 };
 
 export default ItemCursada;

+ 35 - 37
src/scenes/LSListaClases.js

@@ -1,21 +1,21 @@
 import React, { Component } from 'react';
-import { Text, ListView, View, TouchableOpacity } from 'react-native';
+import { Text, ListView, View } from 'react-native';
 import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
 import { Card, CardSection, Button } from '../components/common/';
 
-class LSListaClases extends Component  {
+class LSListaClases extends Component {
 	componentWillMount() {
-    	this.createDataSource(this.props);
+		this.createDataSource(this.props);
 	}
-	componentWillReceiveProps(){
+	componentWillReceiveProps() {
 		this.createDataSource(this.props);
 	}
-  	createDataSource({clases}){
-	    const ds = new ListView.DataSource({
-	      rowHasChanged: (r1,r2) => r1 !== r2
-	    });
-	    this.dataSource = ds.cloneWithRows(clases);
+	createDataSource({ clases }) {
+		const ds = new ListView.DataSource({
+			rowHasChanged: (r1, r2) => r1 !== r2
+		});
+		this.dataSource = ds.cloneWithRows(clases);
 	}
 
 	onClassPress(clase) {
@@ -27,51 +27,49 @@ class LSListaClases extends Component  {
 	renderButton(data) {
 		return (
 			<CardSection>
-				<Button
-					onPress={ () => this.onClassPress(data)}>
-					Ingresar
-				</Button>
+			<Button onPress={() => this.onClassPress(data)} >
+				Ingresar
+			</Button>
 			</CardSection>
 		);
 	}
 
 	renderRow(data) {
 		const moment = require('moment');
+
 		const fecha = moment(data.fecha).local().format('DD/MM/YY');
 
 		return (
 			<Card>
-				<CardSection>
-				  <Text>{data.titulo}</Text>
-				</CardSection>
+			<CardSection>
+			<Text>{ data.titulo}</Text>
+			</CardSection>
 
-				<CardSection>
-					<Text style={{flex:1}}>Profesor:</Text>
-					<Text style={{flex:1, fontWeight: '600'}}>
-						{data.profesor.nombre} {data.profesor.apellido}
-					</Text>
-				</CardSection>
+			<CardSection>
+			<Text style={{ flex: 1 }}>Profesor:</Text>
+			<Text style={{ flex: 1, fontWeight: '600' }}>
+			{ data.profesor.nombre} { data.profesor.apellido}
+			</Text>
+			</CardSection>
 
-				<CardSection>
-				  <Text style={{flex:1}}>Fecha:</Text>
-				  <Text style={{flex:1}}>{fecha}</Text>
-				</CardSection>
+			<CardSection>
+			<Text style={{ flex: 1 }}>Fecha:</Text>
+			<Text style={{ flex: 1 }}>{ fecha}</Text>
+			</CardSection>
 
-				{this.renderButton(data)}
-      		</Card>
-    	);
+			{ this.renderButton(data)}
+			</Card>
+		);
 	}
 
 	render() {
-	    const { cursada } = this.props;
-
 		return (
-			<View style={{flex:1}}>
-				<ListView
-				  enableEmptySections
-				  dataSource={this.dataSource}
-				  renderRow={this.renderRow.bind(this)}
-				/>
+			<View style={{ flex: 1 }}>
+			<ListView
+			enableEmptySections
+			dataSource={this.dataSource}
+			renderRow={this.renderRow.bind(this)}
+			/>
 			</View>
 		);
 	}

+ 61 - 59
src/scenes/ListaClases.js

@@ -4,104 +4,106 @@ import { Text, ListView, View, TouchableOpacity } from 'react-native';
 import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
 import { cursadaFetch } from '../actions/';
-import { Card, CardSection, Button } from '../components/common/';
-import { ConnectionError } from '../components/common';
+import { Card, CardSection, Button, ConnectionError } from '../components/common/';
 
-class ListaClases extends Component  {
+class ListaClases extends Component {
 	componentWillMount() {
-    this.props.cursadaFetch(this.props);
-    this.createDataSource(this.props);
+		this.props.cursadaFetch(this.props);
+		this.createDataSource(this.props);
 	}
 	componentWillReceiveProps(nextProps) {
 		this.createDataSource(nextProps);
 	}
-  createDataSource({clases}){
-    const ds = new ListView.DataSource({
-      rowHasChanged: (r1,r2) => r1 !== r2
-    });
-    this.dataSource = ds.cloneWithRows(clases);
-	}
 
-	onClassPress(cursada,id) {
-		Actions.ViewClase({ cursada, _id:id });
+	onClassPress(cursada, id) {
+		Actions.ViewClase({ cursada, _id: id });
 	}
 
-	onProfPress(id){
+	onProfPress(id) {
 		Actions.ViewProf({ id });
 	}
 
+	createDataSource({ clases }) {
+		const ds = new ListView.DataSource({
+			rowHasChanged: (r1, r2) => r1 !== r2
+		});
+		this.dataSource = ds.cloneWithRows(clases);
+	}
 	renderButton(data) {
-		if (data.desactivada){
+		if (data.desactivada) {
 			return <View />;
 		}
 		return (
 			<CardSection>
-				<Button
-					onPress={ () => this.onClassPress(this.props._id, data._id)}>
-					Ingresar
-				</Button>
+			<Button
+				onPress={() => this.onClassPress(this.props._id, data._id)}
+			>
+			Ingresar
+			</Button>
 			</CardSection>
 		);
 	}
 
-  renderRow(data) {
+	renderRow(data) {
 		const moment = require('moment');
+
 		const fecha = moment(data.fecha).local().format('DD/MM/YY');
 
 		return (
-      <Card>
-        <CardSection>
-          <Text>{data.titulo}</Text>
-        </CardSection>
-
-        <CardSection>
-          <Text style={{flex:1}}>Profesor:</Text>
-					<TouchableOpacity onPress={() => this.onProfPress(data.profesor._id)}>
-          	<Text style={{flex:1, color: '#007aff', fontWeight: '600'}}>
-							{data.profesor.nombre} {data.profesor.apellido}
-						</Text>
-					</TouchableOpacity>
-        </CardSection>
-
-        <CardSection>
-          <Text style={{flex:1}}>Fecha:</Text>
-          <Text style={{flex:1}}>{fecha}</Text>
-        </CardSection>
-
-		{this.renderButton(data)}
-      </Card>
-    );
+			<Card>
+			<CardSection>
+			<Text>{ data.titulo}</Text>
+			</CardSection>
+
+			<CardSection>
+			<Text style={{ flex: 1 }}>Profesor:</Text>
+			<TouchableOpacity onPress={() => this.onProfPress(data.profesor._id)}>
+			<Text style={{ flex: 1, color: '#007aff', fontWeight: '600' }}>
+			{ data.profesor.nombre} { data.profesor.apellido}
+			</Text>
+			</TouchableOpacity>
+			</CardSection>
+
+			<CardSection>
+			<Text style={{ flex: 1 }}>Fecha:</Text>
+			<Text style={{ flex: 1 }}>{ fecha}</Text>
+			</CardSection>
+
+			{ this.renderButton(data)}
+			</Card>
+		);
 	}
 
 	render() {
-	    const { cursada } = this.props;
+		const { cursada } = this.props;
 		if (cursada.error) {
 			return <ConnectionError />;
 		}
 
 		return (
-      <View style={{flex:1}}>
-        <CardSection>
-          <Text style={{textAlign:'center', flex: 1, fontSize:18}}>{cursada.titulo}</Text>
-        </CardSection>
-        <ListView
-          enableEmptySections
-          dataSource={this.dataSource}
-          renderRow={this.renderRow.bind(this)}
-        />
-      </View>
+			<View style={{ flex: 1 }}>
+			<CardSection>
+			<Text style={{ textAlign: 'center', flex: 1, fontSize: 18 }}>{ cursada.titulo}</Text>
+			</CardSection>
+			<ListView
+			enableEmptySections
+			dataSource={this.dataSource}
+			renderRow={this.renderRow.bind(this)}
+			/>
+			</View>
 		);
 	}
-};
+}
 
 const mapStateToProps = state => {
 	const moment = require('moment');
-  const { curCursada } = state.cursadasR;
-  const clases = _.partition(curCursada.clases, n => n.desactivada);
-	const inactivas = _.sortBy(clases[0], [ o => moment(o.fecha).toDate() ]);
-	const activas = _.reverse(_.sortBy(clases[1], [ o => moment(o.fecha).toDate() ]));
 
-	return { cursada: curCursada, clases: _.concat(activas,inactivas) };
+	const { curCursada } = state.cursadasR;
+	const clases = _.partition(curCursada.clases, n => n.desactivada);
+	const inactivas = _.sortBy(clases[0], [o => moment(o.fecha).toDate()]);
+	const activas = _.reverse(_.sortBy(clases[1], [o => moment(o.fecha).toDate()]));
+
+	return { cursada: curCursada, clases: _.concat(activas, inactivas) };
 };
 
 export default connect(mapStateToProps, { cursadaFetch })(ListaClases);

+ 15 - 14
src/scenes/ListaCursadas.js

@@ -1,29 +1,29 @@
 import React, { Component } from 'react';
-import { View, Text, ListView } from 'react-native';
+import { View, ListView } from 'react-native';
 import { connect } from 'react-redux';
 import { cursadasFetch } from '../actions/';
 import ItemCursada from './Cursada/ItemCursada';
 import { ConnectionError } from '../components/common';
 
-class ListaCursadas extends Component  {
+class ListaCursadas extends Component {
 
 	componentWillMount() {
-    	this.props.cursadasFetch();
+		this.props.cursadasFetch();
 		this.createDataSource(this.props);
 	}
 	componentWillReceiveProps(nextProps) {
 		this.createDataSource(nextProps);
 	}
 
-	createDataSource({cursadas,cursos}){
+	createDataSource({ cursadas }) {
 		const ds = new ListView.DataSource({
-			rowHasChanged: (r1,r2) => r1 !== r2
+			rowHasChanged: (r1, r2) => r1 !== r2
 		});
 		this.dataSource = ds.cloneWithRows(cursadas);
 	}
 
 	renderRow(data) {
-		return <ItemCursada data={data}/>;
+		return <ItemCursada data={data} />;
 	}
 
 	render() {
@@ -32,18 +32,19 @@ class ListaCursadas extends Component  {
 		}
 
 		return (
-		<View>
-		      <ListView
-		        enableEmptySections
-		        dataSource={this.dataSource}
-		        renderRow={this.renderRow} />
-		</View>
+			<View>
+			<ListView
+			enableEmptySections
+			dataSource={this.dataSource}
+			renderRow={this.renderRow}
+			/>
+			</View>
 		);
 	}
-};
+}
 
 const mapStateToProps = state => {
-	const { cursadas, cursos, error }  = state.cursadasR;
+	const { cursadas, cursos, error } = state.cursadasR;
 	return { cursadas, cursos, error };
 };
 

+ 5 - 5
src/scenes/Live/Canvas.js

@@ -2,9 +2,9 @@ import React, { Component } from 'react';
 import { Image } from 'react-native';
 
 class Canvas extends Component  {
-	state = { url: "" };
-	diapoUrl(pdf,diapo) {
-		var ret = `https://plataforma.especificosba.com.ar/diapo/${pdf}/${diapo}.png`;
+	state = { url: '' };
+	diapoUrl(pdf, diapo) {
+		const ret = `https://plataforma.especificosba.com.ar/diapo/${pdf}/${diapo}.png`;
 		//console.log(ret);
 		return ret;
 	}
@@ -13,10 +13,10 @@ class Canvas extends Component  {
 		return (
 		<Image
 			source={{ uri: this.diapoUrl(this.props.pdf, this.props.diapo) }}
-			style={ [{ flex:1, resizeMode: "contain" }, this.props.style ]}
+			style={[{ flex: 1, resizeMode: 'contain' }, this.props.style]}
 		/>
 		);
 	}
-};
+}
 
 export default Canvas;

+ 19 - 18
src/scenes/Live/Chat.js

@@ -1,8 +1,8 @@
 import React, { Component } from 'react';
 import { Text, TextInput, ListView } from 'react-native';
-import { Card, CardSection, Input } from '../../components/common';
+import { Card, CardSection } from '../../components/common';
 
-class Chat extends Component  {
+class Chat extends Component {
 
 
 	componentWillMount() {
@@ -12,33 +12,34 @@ class Chat extends Component  {
 		this.createDataSource(nextProps);
 	}
 
-	createDataSource({messages}){
+	createDataSource({ messages }) {
 		const ds = new ListView.DataSource({
-			rowHasChanged: (r1,r2) => r1 !== r2
+			rowHasChanged: (r1, r2) => r1 !== r2
 		});
 		this.dataSource = ds.cloneWithRows(messages);
 	}
 
-	renderRow({time,user,text}) {
-		return <Text>[{time}] {user}: {text}</Text>;
+	renderRow({ time, user, text }) {
+		return <Text>[{ time}] { user}: { text}</Text>;
 	}
 
 	render() {
 		return (
-			<Card style={{flex:1}}>
-				<CardSection>
-					<ListView
-						enableEmptySections
-						dataSource={this.dataSource}
-						style={{flex:1}}
-						renderRow={this.renderRow} />
-				</CardSection>
-				<CardSection>
-					<TextInput style={{flex:1}} placeholder="Comentario" />
-				</CardSection>
+			<Card style={{ flex: 1 }}>
+			<CardSection>
+			<ListView
+				enableEmptySections
+				dataSource={this.dataSource}
+				style={{ flex: 1 }}
+				renderRow={this.renderRow}
+			/>
+			</CardSection>
+			<CardSection>
+			<TextInput style={{ flex: 1 }} placeholder='Comentario' />
+			</CardSection>
 			</Card>
 		);
 	}
-};
+}
 
 export default Chat;

+ 69 - 67
src/scenes/LiveVideo.js

@@ -1,9 +1,7 @@
 import React, { Component } from 'react';
 import {
-  StyleSheet,
-  Text,
-  View,
-  ScrollView
+	StyleSheet,
+	View,
 } from 'react-native';
 
 import Video from 'react-native-video';
@@ -12,81 +10,85 @@ import Socket from '../components/Socket';
 import Chat from './Live/Chat';
 
 class LiveVideo extends Component {
-  state = { pdf: "EBA", diapo: 1, messages: [] };
-  getTime() {
-	var d = new Date();
-	var curr_hour = d.getHours();
-	var curr_min = d.getMinutes();
-	if (curr_min < 10)
-		curr_min='0'+curr_min;
-	return curr_hour+":"+curr_min;
-  }
+	state = { pdf: 'EBA', diapo: 1, messages: [] };
 
-  onMessage(user,text) {
-	  this.setState({messages: [ ...this.state.messages, { time: this.getTime(), user, text }] });
-  }
+	onMessage(user, text) {
+		this.setState({ messages: [...this.state.messages, { time: this.getTime(), user, text }] });
+	}
 
-  onDiapoChanged(pdf, diapo) {
-	console.log("Diapo changed!", pdf, diapo);
-	this.setState({ pdf, diapo });
-  }
+	onDiapoChanged(pdf, diapo) {
+		console.log('Diapo changed!', pdf, diapo);
+		this.setState({ pdf, diapo });
+	}
+	getTime() {
+		const d = new Date();
+		const currHour = d.getHours();
+		let currMin = d.getMinutes();
+		if (currMin < 10) {
+			currMin = `0${currMin}`;
+		}
+		return `${currHour}:${currMin}`;
+	}
 
-  render() {
-    var ScrollableTabView = require('react-native-scrollable-tab-view');
+	render() {
+		const ScrollableTabView = require('react-native-scrollable-tab-view');
 
-    return (
-	  <View style={{flex:1}}>
-		  <ScrollableTabView renderTabBar={ () => <View/> } >
-			  <View tabLabel="Video" style={styles.videoPage}>
-			      <View style={styles.video}>
-			        <Video source={{ uri: "https://plataforma.especificosba.com.ar/hls/movie.m3u8" }}
-						ref={(ref) => { this.player = ref }}
-						playInBackground={true}
-						volume={0.2}
-						resizeMode={"contain"}
-						style={{position:'absolute', top: 0, left: 0, right: 0, bottom:0}}
-					/>
-			      </View>
-			      <View style={styles.imageContainer}>
-					<Canvas pdf={this.state.pdf} diapo={this.state.diapo} style={{flex:1}}/>
-			      </View>
+		return (
+			<View style={{ flex: 1 }}>
+			<ScrollableTabView renderTabBar={() => <View />} >
+			<View tabLabel='Video' style={styles.videoPage}>
+			<View style={styles.video}>
+			<Video
+				source={{ uri: 'https://plataforma.especificosba.com.ar/hls/movie.m3u8' }}
+				ref={(ref) => { this.player = ref; }}
+				volume={0.2}
+				resizeMode={'contain'}
+				style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}
+			/>
+			</View>
+			<View style={styles.imageContainer}>
+			<Canvas pdf={this.state.pdf} diapo={this.state.diapo} style={{ flex: 1 }} />
+			</View>
 
-			  </View>
+			</View>
 
-			  <View tabLabel="Chat">
-					<Chat messages={this.state.messages} />
-   			  </View>
+			<View tabLabel='Chat'>
+			<Chat messages={this.state.messages} />
+			</View>
 
-		  </ScrollableTabView>
-		  <Socket onDiapoChanged={this.onDiapoChanged.bind(this)} onMessage={this.onMessage.bind(this)} />
-	  </View>
+			</ScrollableTabView>
+			<Socket
+				onDiapoChanged={this.onDiapoChanged.bind(this)}
+				onMessage={this.onMessage.bind(this)}
+			/>
+			</View>
 
-    );
-  }
+		);
+	}
 }
 
 const styles = StyleSheet.create({
-  videoPage: {
-	  flexDirection: 'row',
-	  flex: 1
-  },
-  video: {
-	flex:1,
-    justifyContent: 'center',
-    alignItems: 'center',
-    backgroundColor: '#F5FCFF',
-	margin: 5
+	videoPage: {
+		flexDirection: 'row',
+		flex: 1
+	},
+	video: {
+		flex: 1,
+		justifyContent: 'center',
+		alignItems: 'center',
+		backgroundColor: '#F5FCFF',
+		margin: 5
 
-  },
-  imageContainer: {
-	flex:1,
-    margin: 5
-  },
-  instructions: {
-    textAlign: 'center',
-    color: '#333333',
-    marginBottom: 5,
-  },
+	},
+	imageContainer: {
+		flex: 1,
+		margin: 5
+	},
+	instructions: {
+		textAlign: 'center',
+		color: '#333333',
+		marginBottom: 5,
+	},
 });
 
 

+ 121 - 119
src/scenes/LoginForm.js

@@ -1,4 +1,4 @@
-import React, { Component} from 'react';
+import React, { Component } from 'react';
 import { Text, TextInput, View, Image, TouchableOpacity } from 'react-native';
 import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
@@ -7,121 +7,123 @@ import { emailChanged, passwordChanged, loginUser } from '../actions/';
 
 class LoginForm extends Component {
 
-  onEmailChange(text) {
-    this.props.emailChanged(text);
-  }
-
-  onPasswordChange(text){
-    this.props.passwordChanged(text);
-  }
-
-  onRegisterPress() {
-    Actions.register();
-  }
-  onLoginPress(){
-    const { email, password } = this.props;
-    this.props.loginUser({ email, password });
-  }
-
-  renderButton() {
-    if (this.props.loading) {
-      return <Spinner style={{height:40}} size="large" />;
-    }
-    return (
-      <Button onPress={this.onLoginPress.bind(this)}>
-        Ingresar
-      </Button>
-    );
-  }
-  render() {
-    return (
-      <View
-        style={{flex:1,
-          backgroundColor:'#3B618B',
-          alignItems:'center',
-          paddingTop: 55}}>
-
-        <Image source={require('../../img/logo.png')}
-          resizeMode='contain'
-          style={{height:80, marginTop: 20, marginBottom: 20}}
-        />
-        <Text
-          style={{color:'white',fontSize:18, marginBottom: 30}}
-        >
-          PLATAFORMA DE ESTUDIO
-        </Text>
-
-        <TextInput
-          placeholder="email@gmail.com"
-          value={this.props.email}
-          onChangeText={this.onEmailChange.bind(this)}
-          style={styles.inputStyle}
-        />
-
-        <TextInput
-          secureTextEntry
-          placeholder="contraseña"
-          value={this.props.password}
-          onChangeText={this.onPasswordChange.bind(this)}
-          style={styles.inputStyle}
-        />
-
-        <TouchableOpacity style={{alignSelf: 'stretch'}}>
-          <Text style={styles.forgotStyle}>
-            Olvido su contraseña?
-          </Text>
-        </TouchableOpacity>
-
-        <Text style={styles.errorTextStyle}>
-          {this.props.error}
-        </Text>
-
-        {this.renderButton()}
-
-        <Button onPress={this.onRegisterPress.bind(this)}>
-          Registrarse
-        </Button>
-      </View>
-    );
-  }
-}
-
-const styles = {
-  errorTextStyle: {
-    fontSize: 20,
-    alignSelf: 'center',
-    color: 'red'
-  },
-  inputStyle: {
-    alignSelf: 'stretch',
-    color:'#1E3146',
-    backgroundColor:'#D8DFE8',
-    fontSize: 14,
-    height: 40,
-    borderRadius: 8,
-    paddingTop: 10,
-    paddingLeft: 10,
-    paddingBottom: 10,
-    marginBottom: 10,
-    marginLeft: 20,
-    marginRight: 20,
-    textDecorationLine: 'none'
-  },
-  forgotStyle: {
-    color:'#F1F2F2',
-    textAlign:'right',
-    marginRight: 20,
-    marginBottom: 15,
-    fontSize: 12
-  }
-
-}
-
-const mapStateToProps = ({ auth }) => {
-  const { email, password, error, loading } = auth;
-  return { email, password, error, loading };
-};
-
-export default connect(mapStateToProps, {
-  emailChanged, passwordChanged, loginUser
-} )(LoginForm);
+	onEmailChange(text) {
+		this.props.emailChanged(text);
+	}
+
+	onPasswordChange(text) {
+		this.props.passwordChanged(text);
+	}
+
+	onRegisterPress() {
+		Actions.register();
+	}
+	onLoginPress() {
+		const { email, password } = this.props;
+		this.props.loginUser({ email, password });
+	}
+
+	renderButton() {
+		if (this.props.loading) {
+			return <Spinner style={{ height: 40 }} size='large' />;
+		}
+		return (
+			<Button onPress={this.onLoginPress.bind(this)}>
+			Ingresar
+			</Button>
+		);
+	}
+	render() {
+		return (
+			<View
+			style={{ flex: 1,
+				backgroundColor: '#3B618B',
+				alignItems: 'center',
+				paddingTop: 55 }}
+			>
+
+				<Image
+				source={require('../../img/logo.png')}
+				resizeMode='contain'
+				style={{ height: 80, marginTop: 20, marginBottom: 20 }}
+				/>
+				<Text
+				style={{ color: 'white', fontSize: 18, marginBottom: 30 }}
+				>
+				PLATAFORMA DE ESTUDIO
+				</Text>
+
+				<TextInput
+				placeholder='email@gmail.com'
+				value={this.props.email}
+				onChangeText={this.onEmailChange.bind(this)}
+				style={styles.inputStyle}
+				/>
+
+				<TextInput
+				secureTextEntry
+				placeholder='contraseña'
+				value={this.props.password}
+				onChangeText={this.onPasswordChange.bind(this)}
+				style={styles.inputStyle}
+				/>
+
+				<TouchableOpacity style={{ alignSelf: 'stretch' }}>
+				<Text style={styles.forgotStyle}>
+				Olvido su contraseña?
+				</Text>
+				</TouchableOpacity>
+
+				<Text style={styles.errorTextStyle}>
+				{ this.props.error}
+				</Text>
+
+				{ this.renderButton()}
+
+				<Button onPress={this.onRegisterPress.bind(this)}>
+				Registrarse
+				</Button>
+				</View>
+			);
+		}
+	}
+
+	const styles = {
+		errorTextStyle: {
+			fontSize: 20,
+			alignSelf: 'center',
+			color: 'red'
+		},
+		inputStyle: {
+			alignSelf: 'stretch',
+			color: '#1E3146',
+			backgroundColor: '#D8DFE8',
+			fontSize: 14,
+			height: 40,
+			borderRadius: 8,
+			paddingTop: 10,
+			paddingLeft: 10,
+			paddingBottom: 10,
+			marginBottom: 10,
+			marginLeft: 20,
+			marginRight: 20,
+			textDecorationLine: 'none'
+		},
+		forgotStyle: {
+			color: '#F1F2F2',
+			textAlign: 'right',
+			marginRight: 20,
+			marginBottom: 15,
+			fontSize: 12
+		}
+
+	};
+
+	const mapStateToProps = ({ auth }) => {
+		const { email, password, error, loading } = auth;
+		return { email, password, error, loading };
+	};
+
+	export default connect(mapStateToProps, {
+		emailChanged, passwordChanged, loginUser
+	})(LoginForm);

+ 4 - 6
src/scenes/Menu.js

@@ -4,12 +4,10 @@ import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
 
 import { initLSClase } from '../actions/';
-import MyAbout from './MyAbout';
-import LSListaClases from './LSListaClases';
 import { Card, CardSection } from '../components/common';
 
-class Menu extends Component  {
-	componentWillMount(){
+class Menu extends Component {
+	componentWillMount() {
 		this.props.initLSClase();
 	}
 	componentWillReceiveProps() {
@@ -18,7 +16,7 @@ class Menu extends Component  {
 
 	render() {
 		return (
-			<View style={{flex:1}}>
+			<View style={{ flex: 1 }}>
 				<TouchableOpacity onPress={() => Actions.ListaCursadas()}>
 				<Card>
 					<CardSection>
@@ -61,7 +59,7 @@ class Menu extends Component  {
 
 			</View>
 		);
-	};
+	}
 }
 
 export default connect(null, { initLSClase })(Menu);

+ 43 - 36
src/scenes/MyAbout.js

@@ -3,74 +3,81 @@ import { View, Text, Image, Linking, StyleSheet, TouchableOpacity } from 'react-
 import Icon from 'react-native-vector-icons/Ionicons';
 
 class MyAbout extends Component {
-	handleClick = (url) => {
+	handleClick(url) {
 		Linking.canOpenURL(url).then(supported => {
 			if (supported) {
 				Linking.openURL(url);
-	      	} else {
-	        	console.log('Don\'t know how to open URI: ' + url);
-	      	}
+			} else {
+				console.log('Don\'t know how to open URI: ', url);
+			}
 		});
-	};
+	}
 
 	render() {
+		const casa = require('../../img/casa.png');
+
 		const { textColor, viewStyle, iconStyle } = styles;
 		return (
-		<View style={{flex:1,padding:20}}>
-			<Text style={{fontSize:20, alignSelf:'center', fontWeight:'700'}}>
-			  ESPECIFICOS Buenos Aires
+			<View style={{ flex: 1, padding: 20 }}>
+			<Text style={{ fontSize: 20, alignSelf: 'center', fontWeight: '700' }}>
+				ESPECIFICOS Buenos Aires
 			</Text>
 
-			<Image source={require('../../img/casa.png')}
-			  style={{width:350,alignSelf:'center',height:220}}
-			  resizeMode='contain'
+			<Image
+			source={casa}
+			style={{ width: 350, alignSelf: 'center', height: 220 }}
+			resizeMode='contain'
 			/>
-			
-			<TouchableOpacity style={viewStyle}
-				onPress={() => this.handleClick('geo:-34.60761,-58.437967')}>
 
-				<Icon size={30} style={[textColor, iconStyle]} name="md-pin" />
-				<Text style={textColor}>
-					 Leopoldo Marechal 914, CABA, Argentina.
-				</Text>
+			<TouchableOpacity
+				style={viewStyle}
+				onPress={() => this.handleClick('geo:-34.60761,-58.437967')}
+			>
+
+			<Icon size={30 } style={[textColor, iconStyle]} name='md-pin' />
+			<Text style={textColor}>
+				Leopoldo Marechal 914, CABA, Argentina.
+			</Text>
 
 			</TouchableOpacity>
 
-			<TouchableOpacity style={viewStyle}
-				onPress={() => this.handleClick('tel:+541141396860')}>
-				<Icon size={30} style={[textColor, iconStyle]} name="md-call" />
+			<TouchableOpacity
+				style={viewStyle}
+				onPress={() => this.handleClick('tel:+541141396860')}
+			>
+				<Icon size={30 } style={[textColor, iconStyle]} name='md-call' />
 				<View>
-					<Text style={textColor}>
-						+5411 4139-6860/1
-					</Text>
-					<Text style={textColor}>
-						+5411 4982-2892
-					</Text>
+				<Text style={textColor}>
+				+5411 4139-6860/1
+				</Text>
+				<Text style={textColor}>
+				+5411 4982-2892
+				</Text>
 				</View>
 			</TouchableOpacity>
 
 			<View style={viewStyle}>
-				<Icon size={30} style={[textColor, iconStyle]} name="md-time" />
-				<Text style={textColor}>
-					Abierto Lunes a Viernes 9 a 18hs.
-				</Text>
+			<Icon size={30 } style={[textColor, iconStyle]} name='md-time' />
+			<Text style={textColor}>
+			Abierto Lunes a Viernes 9 a 18hs.
+			</Text>
+			</View>
 			</View>
-		</View>
 		);
 	}
 }
 
 const styles = StyleSheet.create({
 	viewStyle: {
-		flexDirection:'row',
+		flexDirection: 'row',
 		alignItems: 'center',
 	},
 	iconStyle: {
-		margin:5,
+		margin: 5,
 		marginRight: 10
 	},
-	textColor:{
-		color:'#6281A2'
+	textColor: {
+		color: '#6281A2'
 	}
 });
 

+ 36 - 31
src/scenes/Profesor.js

@@ -1,52 +1,57 @@
 import React, { Component } from 'react';
-import { Text, ScrollView, View, Image } from 'react-native';
+import { Text, ScrollView, Image } from 'react-native';
 import { connect } from 'react-redux';
 import { profFetch } from '../actions/';
-import { Card, CardSection, Button } from '../components/common';
+import { Card, CardSection } from '../components/common';
 
-class Clase extends Component  {
+class Clase extends Component {
 
 	componentWillMount() {
-    console.log("profProps", this.props);
-    this.props.profFetch({id:this.props.id});
+		console.log('profProps', this.props);
+		this.props.profFetch({ id: this.props.id });
 	}
 
 	render() {
-    console.log("ProfRender", this.props);
+		console.log('ProfRender', this.props);
 		const { profesor } = this.props;
-		const image = `https://plataforma.especificosba.com.ar${profesor.imagen}`;
+		const image = `https://plataforma.especificosba.com.ar${ profesor.imagen}`;
 		console.log(image);
 		return (
 			<ScrollView>
-	      <Card>
-					<CardSection>
-						<Text style={{textAlign:'center',fontSize:18,flex:1,fontWeight:'700'}}>
-							{profesor.nombre} {profesor.apellido}
-						</Text>
-					</CardSection>
-					<CardSection>
-						<Image source={{uri:image}}
-							resizeMode="contain"
-							style={{height:250,flex:1}}
-						/>
-					</CardSection>
-					<CardSection>
-						<Text>E-mail: {profesor.email}</Text>
-					</CardSection>
-					<CardSection>
-						<Text>Web: {profesor.web}</Text>
-					</CardSection>
-					<CardSection>
-						<Text>{profesor.intro}</Text>
-					</CardSection>
-	      </Card>
+			<Card>
+				<CardSection>
+					<Text style={{ textAlign: 'center', fontSize: 18, flex: 1, fontWeight: '700' }}>
+					{ profesor.nombre} { profesor.apellido}
+					</Text>
+				</CardSection>
+
+				<CardSection>
+					<Image
+					source={{ uri: image }} resizeMode='contain'
+					style={{ height: 250, flex: 1 }}
+					/>
+				</CardSection>
+
+				<CardSection>
+					<Text>E-mail: { profesor.email}</Text>
+				</CardSection>
+
+				<CardSection>
+					<Text>Web: { profesor.web}</Text>
+				</CardSection>
+
+				<CardSection>
+					<Text>{ profesor.intro}</Text>
+				</CardSection>
+
+			</Card>
 			</ScrollView>
 		);
 	}
-};
+}
 
 const mapStateToProps = state => {
-  console.log("ProfState:", state);
+	console.log('ProfState: ', state);
 	return { profesor: state.ProfReducer.profesor };
 };
 

+ 78 - 79
src/scenes/RegisterForm.js

@@ -1,96 +1,95 @@
-import React, { Component} from 'react';
+import React, { Component } from 'react';
 import { Text, ListView } from 'react-native';
 import { connect } from 'react-redux';
-import { Actions } from 'react-native-router-flux';
 import { Card, CardSection, Input, Button, Spinner } from '../components/common';
 import { propChanged, registerUser } from '../actions/';
 
 
 class RegisterForm extends Component {
-  fields = [
-    { label: 'E-mail', key: 'email' },
-    { label: 'Nombre', key: 'nombre' },
-    { label: 'Apellido', key: 'apellido' },
-    { label: 'País', key: 'pais' },
-    { label: 'Provincia', key: 'provincia' },
-    { label: 'Ciudad', key: 'ciudad' },
-    { label: 'Dirección', key: 'direccion' },
-    { label: 'Teléfono', key: 'tel' },
-    { label: 'Celular', key: 'cel' }
-  ];
-  componentWillMount() {
-    this.createDataSource(this.fields);
+	componentWillMount() {
+		this.fields = [
+			{ label: 'E-mail', key: 'email' },
+			{ label: 'Nombre', key: 'nombre' },
+			{ label: 'Apellido', key: 'apellido' },
+			{ label: 'País', key: 'pais' },
+			{ label: 'Provincia', key: 'provincia' },
+			{ label: 'Ciudad', key: 'ciudad' },
+			{ label: 'Dirección', key: 'direccion' },
+			{ label: 'Teléfono', key: 'tel' },
+			{ label: 'Celular', key: 'cel' }
+		];
+		this.createDataSource(this.fields);
 	}
 
-  createDataSource(data){
-    const ds = new ListView.DataSource({
-      rowHasChanged: (r1,r2) => r1 !== r2
-    });
-    this.dataSource = ds.cloneWithRows(data);
+	onRegisterPress() {
+		this.props.registerUser({ user: this.props.user });
+	}
+	
+	createDataSource(data) {
+		const ds = new ListView.DataSource({
+			rowHasChanged: (r1, r2) => r1 !== r2
+		});
+		this.dataSource = ds.cloneWithRows(data);
+	}
+	renderButton() {
+		console.log('loading: ', this.props.loading);
+		if (this.props.loading) {
+			return <Spinner size='large' />;
+		}
+		return (
+			<Button onPress={this.onRegisterPress.bind(this)}>
+			Registrar
+			</Button>
+		);
 	}
 
-  onRegisterPress() {
-    this.props.registerUser({ user: this.props.user });
-  }
-
-  renderButton() {
-    console.log("loading:",this.props.loading);
-    if (this.props.loading) {
-      return <Spinner size="large" />;
-    }
-    return (
-      <Button onPress={this.onRegisterPress.bind(this)}>
-        Registrar
-      </Button>
-    );
-  }
-
-  renderItem(item) {
-    return (
-      <CardSection>
-        <Input
-          label={item.label}
-          placeholder={item.placeholder}
-          value={this.props.user[item.key]}
-          editable={false}
-          onChangeText={ () => this.props.propChanged({ key: item.key, val: this.props[item.key] }) }
-        />
-      </CardSection>
-    );
-  }
-  render() {
-    return (
-      <Card>
-        <ListView
-          enableEmptySections
-          dataSource={this.dataSource}
-          renderRow={this.renderItem.bind(this)}
-        />
+	renderItem(item) {
+		return (
+			<CardSection>
+				<Input
+					label={item.label}
+					placeholder={item.placeholder}
+					value={this.props.user[item.key]}
+					editable={false}
+					onChangeText={() =>
+						this.props.propChanged({ key: item.key, val: this.props[item.key] })}
+				/>
+			</CardSection>
+			);
+		}
+		render() {
+			return (
+				<Card>
+					<ListView
+					enableEmptySections
+					dataSource={this.dataSource}
+					renderRow={this.renderItem.bind(this)}
+					/>
 
-        <Text style={styles.errorTextStyle}>
-          {this.props.error}
-        </Text>
-        <CardSection>
-          {this.renderButton()}
-        </CardSection>
-      </Card>
+					<Text style={styles.errorTextStyle}>
+					{ this.props.error}
+					</Text>
+					<CardSection>
+						{ this.renderButton()}
+					</CardSection>
+				</Card>
 
-    );
-  }
-}
+			);
+		}
+	}
 
-const styles = {
-  errorTextStyle: {
-    fontSize: 20,
-    alignSelf: 'center',
-    color: 'red'
-  }
-}
+	const styles = {
+		errorTextStyle: {
+			fontSize: 20,
+			alignSelf: 'center',
+			color: 'red'
+		}
+	};
 
-const mapStateToProps = ({ register }) => {
-  const { error, user, loading } = RegisterReducer;
-  return { error, loading, user };
-};
+	const mapStateToProps = ({ RegisterReducer }) => {
+		const { error, user, loading } = RegisterReducer;
+		return { error, loading, user };
+	};
 
 
-export default connect(mapStateToProps, { propChanged, registerUser } )(RegisterForm);
+	export default connect(mapStateToProps, { propChanged, registerUser })(RegisterForm);