feat(recording/LiveStream): native ui updates

pull/13039/head jitsi-meet_8400
Calin-Teodor 3 years ago committed by Calinteodor
parent 45b7f53294
commit d9749f3da6
  1. 19
      react/features/google-api/components/GoogleSignInButton.native.js
  2. 22
      react/features/google-api/components/styles.js
  3. 118
      react/features/recording/components/LiveStream/native/StreamKeyForm.js
  4. 36
      react/features/recording/components/LiveStream/native/styles.js

@ -1,9 +1,11 @@
// @flow
import React from 'react';
import { Image, Text, TouchableOpacity } from 'react-native';
import { Image, TouchableOpacity } from 'react-native';
import { translate } from '../../base/i18n';
import Button from '../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../base/ui/constants.native';
import AbstractGoogleSignInButton from './AbstractGoogleSignInButton';
import styles from './styles';
@ -33,17 +35,16 @@ class GoogleSignInButton extends AbstractGoogleSignInButton {
* @returns {ReactElement}
*/
render() {
const { onClick, signedIn, t } = this.props;
const { onClick, signedIn } = this.props;
if (signedIn) {
return (
<TouchableOpacity
onPress = { onClick }
style = { styles.signOutButton } >
<Text style = { styles.signOutButtonText }>
{ t('liveStreaming.signOut') }
</Text>
</TouchableOpacity>
<Button
accessibilityLabel = 'liveStreaming.signOut'
labelKey = 'liveStreaming.signOut'
onClick = { onClick }
style = { styles.signOutButton }
type = { BUTTON_TYPES.SECONDARY } />
);
}

@ -1,6 +1,6 @@
// @flow
import { ColorPalette, createStyleSheet } from '../../base/styles';
import { createStyleSheet } from '../../base/styles';
/**
* For styling explanations, see:
@ -34,22 +34,8 @@ export default createStyleSheet({
* Google).
*/
signOutButton: {
alignItems: 'center',
borderColor: ColorPalette.lightGrey,
borderRadius: 3,
borderWidth: 1,
color: ColorPalette.white,
height: BUTTON_HEIGHT,
justifyContent: 'center'
},
/**
* Text of the sign out button.
*/
signOutButtonText: {
color: ColorPalette.blue,
fontSize: 14,
fontWeight: 'bold'
alignSelf: 'center',
maxWidth: 104,
width: 'auto'
}
});

@ -1,11 +1,13 @@
import React from 'react';
import { Linking, Text, TouchableOpacity, View } from 'react-native';
import { Linking, Text, View } from 'react-native';
import { _abstractMapStateToProps } from '../../../../base/dialog';
import { translate } from '../../../../base/i18n';
import { connect } from '../../../../base/redux';
import { StyleType } from '../../../../base/styles';
import Button from '../../../../base/ui/components/native/Button';
import Input from '../../../../base/ui/components/native/Input';
import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
import AbstractStreamKeyForm, {
type Props as AbstractProps
} from '../AbstractStreamKeyForm';
@ -54,81 +56,51 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
const { _dialogStyles, t } = this.props;
return (
<View style = { styles.formWrapper }>
<Text
style = { [
_dialogStyles.text,
styles.text,
styles.streamKeyInputLabel
] }>
{
t('dialog.streamKey')
}
</Text>
<Input
customStyles = {{ input: styles.streamKeyInput }}
onChange = { this._onInputChange }
placeholder = { t('liveStreaming.enterStreamKey') }
value = { this.props.value } />
<View style = { styles.formFooter }>
{
this.state.showValidationError
? <View style = { styles.formFooterItem }>
<Text
style = { [
_dialogStyles.text,
styles.warningText
] }>
{ t('liveStreaming.invalidStreamKey') }
</Text>
</View>
: null
}
<View style = { styles.formFooterItem }>
<TouchableOpacity
onPress = { this._onOpenHelp }
style = { styles.streamKeyHelp } >
<Text
style = { [
_dialogStyles.text,
styles.text
] }>
{
t('liveStreaming.streamIdHelp')
}
</Text>
</TouchableOpacity>
<>
<View style = { styles.formWrapper }>
<Input
customStyles = {{ input: styles.streamKeyInput }}
onChange = { this._onInputChange }
placeholder = { t('liveStreaming.enterStreamKey') }
value = { this.props.value } />
<View style = { styles.formValidation }>
{
this.state.showValidationError
? <View style = { styles.formValidationItem }>
<Text
style = { [
_dialogStyles.text,
styles.warningText
] }>
{ t('liveStreaming.invalidStreamKey') }
</Text>
</View>
: null
}
</View>
</View>
<View>
<TouchableOpacity onPress = { this._onOpenYoutubeTerms }>
<Text
style = { [
_dialogStyles.text,
styles.text,
styles.tcText
] }>
{
t('liveStreaming.youtubeTerms')
}
</Text>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity onPress = { this._onOpenGooglePrivacyPolicy }>
<Text
style = { [
_dialogStyles.text,
styles.text,
styles.tcText
] }>
{
t('liveStreaming.googlePrivacyPolicy')
}
</Text>
</TouchableOpacity>
<View style = { styles.formButtonsWrapper }>
<Button
accessibilityLabel = 'liveStreaming.streamIdHelp'
labelKey = 'liveStreaming.streamIdHelp'
labelStyle = { styles.buttonLabelStyle }
onClick = { this._onOpenHelp }
type = { BUTTON_TYPES.TERTIARY } />
<Button
accessibilityLabel = 'liveStreaming.youtubeTerms'
labelKey = 'liveStreaming.youtubeTerms'
labelStyle = { styles.buttonLabelStyle }
onClick = { this._onOpenYoutubeTerms }
type = { BUTTON_TYPES.TERTIARY } />
<Button
accessibilityLabel = 'liveStreaming.googlePrivacyPolicy'
labelKey = 'liveStreaming.googlePrivacyPolicy'
labelStyle = { styles.buttonLabelStyle }
onClick = { this._onOpenGooglePrivacyPolicy }
type = { BUTTON_TYPES.TERTIARY } />
</View>
</View>
</>
);
}

@ -30,15 +30,25 @@ export default createStyleSheet({
/**
* Wrapper for the last element in the form.
*/
formFooter: {
flexDirection: 'row'
formValidation: {
flexDirection: 'row',
height: BaseTheme.spacing[4]
},
/**
* Wrapper for individual children in the last element of the form.
*/
formFooterItem: {
flex: 1
formValidationItem: {
alignSelf: 'flex-start',
marginVertical: BaseTheme.spacing[1]
},
formButtonsWrapper: {
alignSelf: 'center',
display: 'flex',
maxWidth: 200,
width: 'auto'
},
buttonLabelStyle: {
color: BaseTheme.palette.link01
},
/**
@ -73,22 +83,10 @@ export default createStyleSheet({
*/
streamKeyInput: {
alignSelf: 'stretch',
borderColor: BaseTheme.palette.ui05,
borderBottomWidth: 1,
color: BaseTheme.palette.text01,
fontSize: 14,
height: 40,
marginBottom: 5,
textAlign: 'left'
},
/**
* Label for the previous field.
*/
streamKeyInputLabel: {
alignSelf: 'flex-start'
},
/**
* Custom component to pick a broadcast from the list fetched from Google.
*/

Loading…
Cancel
Save