David hace 9 años
padre
commit
8a70fa821d
Se han modificado 3 ficheros con 16 adiciones y 22 borrados
  1. 0 1
      src/scenes/Live/Canvas.js
  2. 11 17
      src/scenes/Live/Chat.js
  3. 5 4
      src/scenes/LiveVideo.js

+ 0 - 1
src/scenes/Live/Canvas.js

@@ -5,7 +5,6 @@ class Canvas extends Component  {
 	state = { url: '' };
 	diapoUrl(pdf, diapo) {
 		const ret = `https://plataforma.especificosba.com.ar/diapo/${pdf}/${diapo}.png`;
-		//console.log(ret);
 		return ret;
 	}
 

+ 11 - 17
src/scenes/Live/Chat.js

@@ -1,10 +1,8 @@
 import React, { Component } from 'react';
-import { Text, TextInput, ListView } from 'react-native';
-import { Card, CardSection } from '../../components/common';
+import { View, Text, TextInput, ListView } from 'react-native';
 
 class Chat extends Component {
 
-
 	componentWillMount() {
 		this.createDataSource(this.props);
 	}
@@ -20,24 +18,20 @@ class Chat extends Component {
 	}
 
 	renderRow({ time, user, text }) {
-		return <Text>[{ time}] { user}: { text}</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>
+			<View>
+				<ListView
+					enableEmptySections
+					dataSource={this.dataSource}
+					style={{ flex: 1, minHeight: 200 }}
+					renderRow={this.renderRow}
+				/>
+				<TextInput style={{ height: 40, flex: 1 }} placeholder='Comentario' />
+			</View>
 		);
 	}
 }

+ 5 - 4
src/scenes/LiveVideo.js

@@ -10,7 +10,8 @@ import Socket from '../components/Socket';
 import Chat from './Live/Chat';
 
 class LiveVideo extends Component {
-	state = { pdf: 'EBA', diapo: 1, messages: [] };
+	bienvenida = { time: this.getTime(), user: "Sistema", text: "Conectado" };
+	state = { pdf: 'EBA', diapo: 1, messages: [ this.bienvenida ] };
 
 	onMessage(user, text) {
 		this.setState({ messages: [...this.state.messages, { time: this.getTime(), user, text }] });
@@ -47,13 +48,13 @@ class LiveVideo extends Component {
 			/>
 			</View>
 			<View style={styles.imageContainer}>
-			<Canvas pdf={this.state.pdf} diapo={this.state.diapo} style={{ flex: 1 }} />
+				<Canvas pdf={this.state.pdf} diapo={this.state.diapo} style={{ flex: 1 }} />
 			</View>
 
 			</View>
 
-			<View tabLabel='Chat'>
-			<Chat messages={this.state.messages} />
+			<View style={{ flex: 1 }} tabLabel='Chat'>
+				<Chat style={{ flex: 1 }} messages={this.state.messages} />
 			</View>
 
 			</ScrollableTabView>