Bläddra i källkod

styling listaClases

David 9 år sedan
förälder
incheckning
0664ede6f5
3 ändrade filer med 22 tillägg och 33 borttagningar
  1. BIN
      img/listaClases/calendario.png
  2. BIN
      img/listaClases/profesor.png
  3. 22 33
      src/scenes/ListaClases.js

BIN
img/listaClases/calendario.png


BIN
img/listaClases/profesor.png


+ 22 - 33
src/scenes/ListaClases.js

@@ -1,6 +1,6 @@
 import _ from 'lodash';
 import React, { Component } from 'react';
-import { Text, ListView, View, TouchableOpacity } from 'react-native';
+import { Image, Text, ListView, View, TouchableOpacity } from 'react-native';
 import { connect } from 'react-redux';
 import { Actions } from 'react-native-router-flux';
 import { cursadaFetch } from '../actions/';
@@ -30,48 +30,37 @@ class ListaClases extends Component {
 		});
 		this.dataSource = ds.cloneWithRows(clases);
 	}
-	renderButton(data) {
-		if (data.desactivada) {
-			return <View />;
-		}
-		return (
-			<CardSection>
-			<Button
-				onPress={() => this.onClassPress(this.props._id, data._id)}
-			>
-			Ingresar
-			</Button>
-			</CardSection>
-		);
-	}
 
 	renderRow(data) {
 		const moment = require('moment');
+		const calendar = require('../../img/listaClases/calendario.png');
+		const professor = require('../../img/listaClases/profesor.png');
 
 		const fecha = moment(data.fecha).local().format('DD/MM/YY');
 
 		return (
+			<TouchableOpacity
+				onPress={() => { data.desactivada ? null : this.onClassPress(this.props._id, data._id)}}
+			>
 			<Card style={{backgroundColor:'#fff'}}>
-			<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>
+				<CardSection>
+					<Text style={{fontSize:15}}>{data.titulo}</Text>
+				</CardSection>
 
-			{ this.renderButton(data)}
+				<CardSection>
+					<View style={{ flex: 1, flexDirection: 'row' }}>
+						<Image source={calendar} style={{marginRight:10,height:20}} resizeMode='contain' />
+						<Text style={{ color: '#6281A2' }}>{fecha}</Text>
+					</View>
+					<View style={{ flex: 1, flexDirection: 'row' }}>
+						<Image source={professor} style={{marginRight:10,height:20}} resizeMode='contain' />
+						<Text style={{ color: '#6281A2' }}>
+							{data.profesor.nombre} {data.profesor.apellido}
+						</Text>
+					</View>
+				</CardSection>
 			</Card>
+			</TouchableOpacity>
 		);
 	}