2016-10-05 14:36:59 +00:00
|
|
|
import React from 'react';
|
2017-06-05 18:00:02 +00:00
|
|
|
import { TextInput, TouchableHighlight, View } from 'react-native';
|
2016-10-05 14:36:59 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2017-03-01 02:55:12 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2017-06-05 18:00:02 +00:00
|
|
|
import { Link, Text } from '../../base/react';
|
2016-11-29 20:04:56 +00:00
|
|
|
import { ColorPalette } from '../../base/styles';
|
|
|
|
|
2017-01-28 23:34:57 +00:00
|
|
|
import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
|
2017-06-10 22:50:42 +00:00
|
|
|
import styles from './styles';
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2016-11-29 20:04:56 +00:00
|
|
|
/**
|
2016-12-11 23:41:14 +00:00
|
|
|
* The URL at which the privacy policy is available to the user.
|
2016-11-29 20:04:56 +00:00
|
|
|
*/
|
2016-12-11 23:41:14 +00:00
|
|
|
const PRIVACY_URL = 'https://jitsi.org/meet/privacy';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL at which the user may send feedback.
|
|
|
|
*/
|
|
|
|
const SEND_FEEDBACK_URL = 'mailto:support@jitsi.org';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL at which the terms (of service/use) are available to the user.
|
|
|
|
*/
|
|
|
|
const TERMS_URL = 'https://jitsi.org/meet/terms';
|
2016-11-29 20:04:56 +00:00
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* The native container rendering the welcome page.
|
|
|
|
*
|
|
|
|
* @extends AbstractWelcomePage
|
|
|
|
*/
|
|
|
|
class WelcomePage extends AbstractWelcomePage {
|
2016-12-01 01:52:39 +00:00
|
|
|
/**
|
|
|
|
* WelcomePage component's property types.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static propTypes = AbstractWelcomePage.propTypes
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* Renders a prompt for entering a room name.
|
|
|
|
*
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View style = { styles.container }>
|
2016-11-23 21:46:46 +00:00
|
|
|
{
|
|
|
|
this._renderLocalVideo()
|
|
|
|
}
|
2016-11-29 20:04:56 +00:00
|
|
|
{
|
|
|
|
this._renderLocalVideoOverlay()
|
|
|
|
}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-12-11 23:41:14 +00:00
|
|
|
/**
|
|
|
|
* Renders legal-related content such as Terms of service/use, Privacy
|
|
|
|
* policy, etc.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderLegalese() {
|
2017-02-23 16:56:25 +00:00
|
|
|
const { t } = this.props;
|
|
|
|
|
2016-12-11 23:41:14 +00:00
|
|
|
return (
|
|
|
|
<View style = { styles.legaleseContainer }>
|
|
|
|
<Link
|
|
|
|
style = { styles.legaleseItem }
|
|
|
|
url = { TERMS_URL }>
|
2017-02-23 16:56:25 +00:00
|
|
|
{ t('welcomepage.terms') }
|
2016-12-11 23:41:14 +00:00
|
|
|
</Link>
|
|
|
|
<Link
|
|
|
|
style = { styles.legaleseItem }
|
|
|
|
url = { PRIVACY_URL }>
|
2017-02-23 16:56:25 +00:00
|
|
|
{ t('welcomepage.privacy') }
|
2016-12-11 23:41:14 +00:00
|
|
|
</Link>
|
|
|
|
<Link
|
|
|
|
style = { styles.legaleseItem }
|
|
|
|
url = { SEND_FEEDBACK_URL }>
|
2017-02-23 16:56:25 +00:00
|
|
|
{ t('welcomepage.sendFeedback') }
|
2016-12-11 23:41:14 +00:00
|
|
|
</Link>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-11-29 20:04:56 +00:00
|
|
|
/**
|
|
|
|
* Renders a View over the local video. The latter is thought of as the
|
|
|
|
* background (content) of this WelcomePage. The former is thought of as the
|
|
|
|
* foreground (content) of this WelcomePage such as the room name input, the
|
|
|
|
* button to initiate joining the specified room, etc.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
_renderLocalVideoOverlay() {
|
2017-02-23 16:56:25 +00:00
|
|
|
const { t } = this.props;
|
|
|
|
|
2016-11-29 20:04:56 +00:00
|
|
|
return (
|
|
|
|
<View style = { styles.localVideoOverlay }>
|
2016-10-05 14:36:59 +00:00
|
|
|
<View style = { styles.roomContainer }>
|
2017-02-23 16:56:25 +00:00
|
|
|
<Text style = { styles.title }>
|
|
|
|
{ t('welcomepage.roomname') }
|
|
|
|
</Text>
|
2016-10-05 14:36:59 +00:00
|
|
|
<TextInput
|
2016-12-22 23:28:57 +00:00
|
|
|
accessibilityLabel = { 'Input room name.' }
|
2016-10-05 14:36:59 +00:00
|
|
|
autoCapitalize = 'none'
|
2016-12-15 21:16:30 +00:00
|
|
|
autoComplete = { false }
|
2016-10-05 14:36:59 +00:00
|
|
|
autoCorrect = { false }
|
2017-01-06 15:06:35 +00:00
|
|
|
autoFocus = { false }
|
2016-10-05 14:36:59 +00:00
|
|
|
onChangeText = { this._onRoomChange }
|
2017-02-23 16:56:25 +00:00
|
|
|
placeholder = { t('welcomepage.roomnamePlaceHolder') }
|
2016-10-05 14:36:59 +00:00
|
|
|
style = { styles.textInput }
|
2016-12-15 21:16:30 +00:00
|
|
|
underlineColorAndroid = 'transparent'
|
2016-10-05 14:36:59 +00:00
|
|
|
value = { this.state.room } />
|
|
|
|
<TouchableHighlight
|
2016-12-22 23:28:57 +00:00
|
|
|
accessibilityLabel = { 'Tap to Join.' }
|
2016-10-05 14:36:59 +00:00
|
|
|
disabled = { this._isJoinDisabled() }
|
2016-12-01 18:55:42 +00:00
|
|
|
onPress = { this._onJoin }
|
2016-10-05 14:36:59 +00:00
|
|
|
style = { styles.button }
|
2016-11-29 20:04:56 +00:00
|
|
|
underlayColor = { ColorPalette.white }>
|
2017-02-23 16:56:25 +00:00
|
|
|
<Text style = { styles.buttonText }>
|
|
|
|
{ t('welcomepage.join') }
|
|
|
|
</Text>
|
2016-10-05 14:36:59 +00:00
|
|
|
</TouchableHighlight>
|
|
|
|
</View>
|
2016-12-11 23:41:14 +00:00
|
|
|
{
|
|
|
|
this._renderLegalese()
|
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-23 16:56:25 +00:00
|
|
|
export default translate(connect(_mapStateToProps)(WelcomePage));
|