|
@@ -1,11 +1,13 @@
|
1
|
1
|
import React from 'react';
|
2
|
|
-import { Linking, Text, TouchableOpacity, View } from 'react-native';
|
|
2
|
+import { Linking, Text, View } from 'react-native';
|
3
|
3
|
|
4
|
4
|
import { _abstractMapStateToProps } from '../../../../base/dialog';
|
5
|
5
|
import { translate } from '../../../../base/i18n';
|
6
|
6
|
import { connect } from '../../../../base/redux';
|
7
|
7
|
import { StyleType } from '../../../../base/styles';
|
|
8
|
+import Button from '../../../../base/ui/components/native/Button';
|
8
|
9
|
import Input from '../../../../base/ui/components/native/Input';
|
|
10
|
+import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
|
9
|
11
|
import AbstractStreamKeyForm, {
|
10
|
12
|
type Props as AbstractProps
|
11
|
13
|
} from '../AbstractStreamKeyForm';
|
|
@@ -54,81 +56,51 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
|
54
|
56
|
const { _dialogStyles, t } = this.props;
|
55
|
57
|
|
56
|
58
|
return (
|
57
|
|
- <View style = { styles.formWrapper }>
|
58
|
|
- <Text
|
59
|
|
- style = { [
|
60
|
|
- _dialogStyles.text,
|
61
|
|
- styles.text,
|
62
|
|
- styles.streamKeyInputLabel
|
63
|
|
- ] }>
|
64
|
|
- {
|
65
|
|
- t('dialog.streamKey')
|
66
|
|
- }
|
67
|
|
- </Text>
|
68
|
|
- <Input
|
69
|
|
- customStyles = {{ input: styles.streamKeyInput }}
|
70
|
|
- onChange = { this._onInputChange }
|
71
|
|
- placeholder = { t('liveStreaming.enterStreamKey') }
|
72
|
|
- value = { this.props.value } />
|
73
|
|
- <View style = { styles.formFooter }>
|
74
|
|
- {
|
75
|
|
- this.state.showValidationError
|
76
|
|
- ? <View style = { styles.formFooterItem }>
|
77
|
|
- <Text
|
78
|
|
- style = { [
|
79
|
|
- _dialogStyles.text,
|
80
|
|
- styles.warningText
|
81
|
|
- ] }>
|
82
|
|
- { t('liveStreaming.invalidStreamKey') }
|
83
|
|
- </Text>
|
84
|
|
- </View>
|
85
|
|
- : null
|
86
|
|
- }
|
87
|
|
- <View style = { styles.formFooterItem }>
|
88
|
|
- <TouchableOpacity
|
89
|
|
- onPress = { this._onOpenHelp }
|
90
|
|
- style = { styles.streamKeyHelp } >
|
91
|
|
- <Text
|
92
|
|
- style = { [
|
93
|
|
- _dialogStyles.text,
|
94
|
|
- styles.text
|
95
|
|
- ] }>
|
96
|
|
- {
|
97
|
|
- t('liveStreaming.streamIdHelp')
|
98
|
|
- }
|
99
|
|
- </Text>
|
100
|
|
- </TouchableOpacity>
|
|
59
|
+ <>
|
|
60
|
+ <View style = { styles.formWrapper }>
|
|
61
|
+ <Input
|
|
62
|
+ customStyles = {{ input: styles.streamKeyInput }}
|
|
63
|
+ onChange = { this._onInputChange }
|
|
64
|
+ placeholder = { t('liveStreaming.enterStreamKey') }
|
|
65
|
+ value = { this.props.value } />
|
|
66
|
+ <View style = { styles.formValidation }>
|
|
67
|
+ {
|
|
68
|
+ this.state.showValidationError
|
|
69
|
+ ? <View style = { styles.formValidationItem }>
|
|
70
|
+ <Text
|
|
71
|
+ style = { [
|
|
72
|
+ _dialogStyles.text,
|
|
73
|
+ styles.warningText
|
|
74
|
+ ] }>
|
|
75
|
+ { t('liveStreaming.invalidStreamKey') }
|
|
76
|
+ </Text>
|
|
77
|
+ </View>
|
|
78
|
+ : null
|
|
79
|
+ }
|
|
80
|
+
|
101
|
81
|
</View>
|
102
|
82
|
</View>
|
103
|
|
- <View>
|
104
|
|
- <TouchableOpacity onPress = { this._onOpenYoutubeTerms }>
|
105
|
|
- <Text
|
106
|
|
- style = { [
|
107
|
|
- _dialogStyles.text,
|
108
|
|
- styles.text,
|
109
|
|
- styles.tcText
|
110
|
|
- ] }>
|
111
|
|
- {
|
112
|
|
- t('liveStreaming.youtubeTerms')
|
113
|
|
- }
|
114
|
|
- </Text>
|
115
|
|
- </TouchableOpacity>
|
116
|
|
- </View>
|
117
|
|
- <View>
|
118
|
|
- <TouchableOpacity onPress = { this._onOpenGooglePrivacyPolicy }>
|
119
|
|
- <Text
|
120
|
|
- style = { [
|
121
|
|
- _dialogStyles.text,
|
122
|
|
- styles.text,
|
123
|
|
- styles.tcText
|
124
|
|
- ] }>
|
125
|
|
- {
|
126
|
|
- t('liveStreaming.googlePrivacyPolicy')
|
127
|
|
- }
|
128
|
|
- </Text>
|
129
|
|
- </TouchableOpacity>
|
|
83
|
+ <View style = { styles.formButtonsWrapper }>
|
|
84
|
+ <Button
|
|
85
|
+ accessibilityLabel = 'liveStreaming.streamIdHelp'
|
|
86
|
+ labelKey = 'liveStreaming.streamIdHelp'
|
|
87
|
+ labelStyle = { styles.buttonLabelStyle }
|
|
88
|
+ onClick = { this._onOpenHelp }
|
|
89
|
+ type = { BUTTON_TYPES.TERTIARY } />
|
|
90
|
+ <Button
|
|
91
|
+ accessibilityLabel = 'liveStreaming.youtubeTerms'
|
|
92
|
+ labelKey = 'liveStreaming.youtubeTerms'
|
|
93
|
+ labelStyle = { styles.buttonLabelStyle }
|
|
94
|
+ onClick = { this._onOpenYoutubeTerms }
|
|
95
|
+ type = { BUTTON_TYPES.TERTIARY } />
|
|
96
|
+ <Button
|
|
97
|
+ accessibilityLabel = 'liveStreaming.googlePrivacyPolicy'
|
|
98
|
+ labelKey = 'liveStreaming.googlePrivacyPolicy'
|
|
99
|
+ labelStyle = { styles.buttonLabelStyle }
|
|
100
|
+ onClick = { this._onOpenGooglePrivacyPolicy }
|
|
101
|
+ type = { BUTTON_TYPES.TERTIARY } />
|
130
|
102
|
</View>
|
131
|
|
- </View>
|
|
103
|
+ </>
|
132
|
104
|
);
|
133
|
105
|
}
|
134
|
106
|
|