浏览代码

[RN] Make feature dialogs branded: recording

master
Bettenbuk Zoltan 6 年前
父节点
当前提交
62e7fd7e8e
共有 23 个文件被更改,包括 285 次插入217 次删除
  1. 6
    3
      react/features/base/dialog/components/DialogContent.js
  2. 1
    0
      react/features/google-api/components/styles.js
  3. 1
    30
      react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.js
  4. 1
    28
      react/features/recording/components/LiveStream/AbstractStopLiveStreamDialog.js
  5. 7
    5
      react/features/recording/components/LiveStream/native/GoogleSigninForm.js
  6. 32
    24
      react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js
  7. 9
    8
      react/features/recording/components/LiveStream/native/StopLiveStreamDialog.js
  8. 3
    2
      react/features/recording/components/LiveStream/native/StreamKeyForm.js
  9. 2
    2
      react/features/recording/components/LiveStream/native/StreamKeyPicker.js
  10. 17
    3
      react/features/recording/components/LiveStream/native/styles.js
  11. 34
    23
      react/features/recording/components/LiveStream/web/StartLiveStreamDialog.js
  12. 16
    3
      react/features/recording/components/LiveStream/web/StopLiveStreamDialog.js
  13. 1
    2
      react/features/recording/components/Recording/AbstractRecordButton.js
  14. 7
    36
      react/features/recording/components/Recording/AbstractStartRecordingDialog.js
  15. 1
    28
      react/features/recording/components/Recording/AbstractStopRecordingDialog.js
  16. 7
    5
      react/features/recording/components/Recording/StartRecordingDialogContent.js
  17. 54
    0
      react/features/recording/components/Recording/native/StartRecordingDialog.js
  18. 8
    8
      react/features/recording/components/Recording/native/StopRecordingDialog.js
  19. 1
    0
      react/features/recording/components/Recording/native/index.js
  20. 11
    1
      react/features/recording/components/Recording/styles.native.js
  21. 50
    0
      react/features/recording/components/Recording/web/StartRecordingDialog.js
  22. 15
    6
      react/features/recording/components/Recording/web/StopRecordingDialog.js
  23. 1
    0
      react/features/recording/components/Recording/web/index.js

+ 6
- 3
react/features/base/dialog/components/DialogContent.js 查看文件

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 
4
 
5
 import { Container, Text } from '../../react';
5
 import { Container, Text } from '../../react';
6
+import { type StyleType } from '../../styles';
6
 
7
 
7
 import styles from './styles';
8
 import styles from './styles';
8
 
9
 
11
     /**
12
     /**
12
      * Children of the component.
13
      * Children of the component.
13
      */
14
      */
14
-    children: string | React$Node
15
+    children: string | React$Node,
16
+
17
+    style: ?StyleType
15
 };
18
 };
16
 
19
 
17
 /**
20
 /**
25
      * @inheritdoc
28
      * @inheritdoc
26
      */
29
      */
27
     render() {
30
     render() {
28
-        const { children } = this.props;
31
+        const { children, style } = this.props;
29
 
32
 
30
         const childrenComponent = typeof children === 'string'
33
         const childrenComponent = typeof children === 'string'
31
-            ? <Text>{ children }</Text>
34
+            ? <Text style = { style }>{ children }</Text>
32
             : children;
35
             : children;
33
 
36
 
34
         return (
37
         return (

+ 1
- 0
react/features/google-api/components/styles.js 查看文件

38
         borderColor: ColorPalette.lightGrey,
38
         borderColor: ColorPalette.lightGrey,
39
         borderRadius: 3,
39
         borderRadius: 3,
40
         borderWidth: 1,
40
         borderWidth: 1,
41
+        color: ColorPalette.white,
41
         height: BUTTON_HEIGHT,
42
         height: BUTTON_HEIGHT,
42
         justifyContent: 'center'
43
         justifyContent: 'center'
43
     },
44
     },

+ 1
- 30
react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4
 
4
 
5
 import {
5
 import {
6
     createRecordingDialogEvent,
6
     createRecordingDialogEvent,
7
     sendAnalytics
7
     sendAnalytics
8
 } from '../../../analytics';
8
 } from '../../../analytics';
9
-import { Dialog } from '../../../base/dialog';
10
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
11
 
10
 
12
 /**
11
 /**
140
         this._isMounted = false;
139
         this._isMounted = false;
141
     }
140
     }
142
 
141
 
143
-    /**
144
-     * Implements {@code Component}'s render.
145
-     *
146
-     * @inheritdoc
147
-     */
148
-    render() {
149
-        return (
150
-            <Dialog
151
-                cancelTitleKey = 'dialog.Cancel'
152
-                okTitleKey = 'dialog.startLiveStreaming'
153
-                onCancel = { this._onCancel }
154
-                onSubmit = { this._onSubmit }
155
-                titleKey = 'liveStreaming.start'
156
-                width = { 'small' }>
157
-                {
158
-                    this._renderDialogContent()
159
-                }
160
-            </Dialog>
161
-        );
162
-    }
163
-
164
     _onCancel: () => boolean;
142
     _onCancel: () => boolean;
165
 
143
 
166
     /**
144
     /**
257
             this.setState(newState);
235
             this.setState(newState);
258
         }
236
         }
259
     }
237
     }
260
-
261
-    /**
262
-     * Renders the platform specific dialog content.
263
-     *
264
-     * @returns {React$Component}
265
-     */
266
-    _renderDialogContent: () => React$Component<*>
267
 }
238
 }
268
 
239
 
269
 /**
240
 /**

+ 1
- 28
react/features/recording/components/LiveStream/AbstractStopLiveStreamDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4
 
4
 
5
-import { Dialog } from '../../../base/dialog';
6
 import {
5
 import {
7
     createRecordingDialogEvent,
6
     createRecordingDialogEvent,
8
     sendAnalytics
7
     sendAnalytics
53
         this._onSubmit = this._onSubmit.bind(this);
52
         this._onSubmit = this._onSubmit.bind(this);
54
     }
53
     }
55
 
54
 
56
-    /**
57
-     * Implements React's {@link Component#render()}.
58
-     *
59
-     * @inheritdoc
60
-     * @returns {ReactElement}
61
-     */
62
-    render() {
63
-        return (
64
-            <Dialog
65
-                okTitleKey = 'dialog.stopLiveStreaming'
66
-                onSubmit = { this._onSubmit }
67
-                titleKey = 'dialog.liveStreaming'
68
-                width = 'small'>
69
-                { this._renderDialogContent() }
70
-            </Dialog>
71
-        );
72
-    }
73
-
74
     _onSubmit: () => boolean;
55
     _onSubmit: () => boolean;
75
 
56
 
76
     /**
57
     /**
90
 
71
 
91
         return true;
72
         return true;
92
     }
73
     }
93
-
94
-    /**
95
-     * Function to be implemented by the platform specific implementations.
96
-     *
97
-     * @private
98
-     * @returns {React$Component<*>}
99
-     */
100
-    _renderDialogContent: () => React$Component<*>
101
 }
74
 }
102
 
75
 
103
 /**
76
 /**

+ 7
- 5
react/features/recording/components/LiveStream/native/GoogleSigninForm.js 查看文件

126
             return null;
126
             return null;
127
         }
127
         }
128
 
128
 
129
+        const userInfo = signedInUser
130
+            ? `${t('liveStreaming.signedInAs')} ${signedInUser}`
131
+            : t('liveStreaming.signInCTA');
132
+
129
         return (
133
         return (
130
             <View style = { styles.formWrapper }>
134
             <View style = { styles.formWrapper }>
131
                 <View style = { styles.helpText }>
135
                 <View style = { styles.helpText }>
132
-                    { signedInUser ? <Text>
133
-                        { `${t('liveStreaming.signedInAs')} ${signedInUser}` }
134
-                    </Text> : <Text>
135
-                        { t('liveStreaming.signInCTA') }
136
-                    </Text> }
136
+                    <Text style = { styles.text }>
137
+                        { userInfo }
138
+                    </Text>
137
                 </View>
139
                 </View>
138
                 <GoogleSignInButton
140
                 <GoogleSignInButton
139
                     onClick = { this._onGoogleButtonPress }
141
                     onClick = { this._onGoogleButtonPress }

+ 32
- 24
react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js 查看文件

4
 import { View } from 'react-native';
4
 import { View } from 'react-native';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
+import { CustomSubmitDialog } from '../../../../base/dialog';
7
 import { translate } from '../../../../base/i18n';
8
 import { translate } from '../../../../base/i18n';
8
 import { googleApi } from '../../../../google-api';
9
 import { googleApi } from '../../../../google-api';
9
 
10
 
36
             = this._onStreamKeyChangeNative.bind(this);
37
             = this._onStreamKeyChangeNative.bind(this);
37
         this._onStreamKeyPick = this._onStreamKeyPick.bind(this);
38
         this._onStreamKeyPick = this._onStreamKeyPick.bind(this);
38
         this._onUserChanged = this._onUserChanged.bind(this);
39
         this._onUserChanged = this._onUserChanged.bind(this);
39
-        this._renderDialogContent = this._renderDialogContent.bind(this);
40
     }
40
     }
41
 
41
 
42
+    /**
43
+     * Implements {@code Component}'s render.
44
+     *
45
+     * @inheritdoc
46
+     */
47
+    render() {
48
+        return (
49
+            <CustomSubmitDialog
50
+                okTitleKey = 'dialog.startLiveStreaming'
51
+                onCancel = { this._onCancel }
52
+                onSubmit = { this._onSubmit } >
53
+                <View style = { styles.startDialogWrapper }>
54
+                    <GoogleSigninForm
55
+                        onUserChanged = { this._onUserChanged } />
56
+                    <StreamKeyPicker
57
+                        broadcasts = { this.state.broadcasts }
58
+                        onChange = { this._onStreamKeyPick } />
59
+                    <StreamKeyForm
60
+                        onChange = { this._onStreamKeyChangeNative }
61
+                        value = {
62
+                            this.state.streamKey || this.props._streamKey
63
+                        } />
64
+                </View>
65
+            </CustomSubmitDialog>
66
+        );
67
+    }
68
+
69
+    _onCancel: () => boolean;
70
+
71
+    _onSubmit: () => boolean;
72
+
42
     _onStreamKeyChange: string => void
73
     _onStreamKeyChange: string => void
43
 
74
 
44
     _onStreamKeyChangeNative: string => void;
75
     _onStreamKeyChangeNative: string => void;
102
             });
133
             });
103
         }
134
         }
104
     }
135
     }
105
-
106
-    _renderDialogContent: () => React$Component<*>
107
-
108
-    /**
109
-     * Renders the platform specific dialog content.
110
-     *
111
-     * @returns {React$Component}
112
-     */
113
-    _renderDialogContent() {
114
-        return (
115
-            <View style = { styles.startDialogWrapper }>
116
-                <GoogleSigninForm
117
-                    onUserChanged = { this._onUserChanged } />
118
-                <StreamKeyPicker
119
-                    broadcasts = { this.state.broadcasts }
120
-                    onChange = { this._onStreamKeyPick } />
121
-                <StreamKeyForm
122
-                    onChange = { this._onStreamKeyChangeNative }
123
-                    value = { this.state.streamKey || this.props._streamKey } />
124
-            </View>
125
-        );
126
-    }
127
-
128
 }
136
 }
129
 
137
 
130
 export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));
138
 export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));

+ 9
- 8
react/features/recording/components/LiveStream/native/StopLiveStreamDialog.js 查看文件

3
 import React from 'react';
3
 import React from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
-import { DialogContent } from '../../../../base/dialog';
6
+import { ConfirmDialog } from '../../../../base/dialog';
7
 import { translate } from '../../../../base/i18n';
7
 import { translate } from '../../../../base/i18n';
8
 
8
 
9
 import AbstractStopLiveStreamDialog, {
9
 import AbstractStopLiveStreamDialog, {
19
 class StopLiveStreamDialog extends AbstractStopLiveStreamDialog {
19
 class StopLiveStreamDialog extends AbstractStopLiveStreamDialog {
20
 
20
 
21
     /**
21
     /**
22
-     * Renders the platform specific {@code Dialog} content.
22
+     * Implements React's {@link Component#render()}.
23
      *
23
      *
24
      * @inheritdoc
24
      * @inheritdoc
25
+     * @returns {ReactElement}
25
      */
26
      */
26
-    _renderDialogContent() {
27
+    render() {
27
         return (
28
         return (
28
-            <DialogContent>
29
-                {
30
-                    this.props.t('dialog.stopStreamingWarning')
31
-                }
32
-            </DialogContent>
29
+            <ConfirmDialog
30
+                contentKey = 'dialog.stopStreamingWarning'
31
+                onSubmit = { this._onSubmit } />
33
         );
32
         );
34
     }
33
     }
34
+
35
+    _onSubmit: () => boolean
35
 }
36
 }
36
 
37
 
37
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));
38
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));

+ 3
- 2
react/features/recording/components/LiveStream/native/StreamKeyForm.js 查看文件

9
     type Props
9
     type Props
10
 } from '../AbstractStreamKeyForm';
10
 } from '../AbstractStreamKeyForm';
11
 
11
 
12
-import styles from './styles';
12
+import styles, { PLACEHOLDER_COLOR } from './styles';
13
 
13
 
14
 /**
14
 /**
15
  * A React Component for entering a key for starting a YouTube live stream.
15
  * A React Component for entering a key for starting a YouTube live stream.
49
                 <TextInput
49
                 <TextInput
50
                     onChangeText = { this._onInputChange }
50
                     onChangeText = { this._onInputChange }
51
                     placeholder = { t('liveStreaming.enterStreamKey') }
51
                     placeholder = { t('liveStreaming.enterStreamKey') }
52
+                    placeholderTextColor = { PLACEHOLDER_COLOR }
52
                     style = { styles.streamKeyInput }
53
                     style = { styles.streamKeyInput }
53
                     value = { this.props.value } />
54
                     value = { this.props.value } />
54
                 <TouchableOpacity
55
                 <TouchableOpacity
55
                     onPress = { this._onOpenHelp }
56
                     onPress = { this._onOpenHelp }
56
                     style = { styles.streamKeyHelp } >
57
                     style = { styles.streamKeyHelp } >
57
-                    <Text>
58
+                    <Text style = { styles.text }>
58
                         {
59
                         {
59
                             t('liveStreaming.streamIdHelp')
60
                             t('liveStreaming.streamIdHelp')
60
                         }
61
                         }

+ 2
- 2
react/features/recording/components/LiveStream/native/StreamKeyPicker.js 查看文件

74
         return (
74
         return (
75
             <View style = { styles.formWrapper }>
75
             <View style = { styles.formWrapper }>
76
                 <View style = { styles.streamKeyPickerCta }>
76
                 <View style = { styles.streamKeyPickerCta }>
77
-                    <Text>
77
+                    <Text style = { styles.text }>
78
                         { this.props.t('liveStreaming.choose') }
78
                         { this.props.t('liveStreaming.choose') }
79
                     </Text>
79
                     </Text>
80
                 </View>
80
                 </View>
90
                                     ? styles.streamKeyPickerItemHighlight : null
90
                                     ? styles.streamKeyPickerItemHighlight : null
91
                             ] }
91
                             ] }
92
                             underlayColor = { TOUCHABLE_UNDERLAY }>
92
                             underlayColor = { TOUCHABLE_UNDERLAY }>
93
-                            <Text style = { styles.streamKeyPickerItemText }>
93
+                            <Text style = { styles.text }>
94
                                 { broadcast.title }
94
                                 { broadcast.title }
95
                             </Text>
95
                             </Text>
96
                         </TouchableHighlight>))
96
                         </TouchableHighlight>))

+ 17
- 3
react/features/recording/components/LiveStream/native/styles.js 查看文件

11
  */
11
  */
12
 export const ACTIVE_OPACITY = 0.3;
12
 export const ACTIVE_OPACITY = 0.3;
13
 
13
 
14
+/**
15
+ * Color for the key input field placeholder.
16
+ */
17
+export const PLACEHOLDER_COLOR = ColorPalette.lightGrey;
18
+
14
 /**
19
 /**
15
  * Underlay of the TouchableHighlight.
20
  * Underlay of the TouchableHighlight.
16
  */
21
  */
69
      */
74
      */
70
     streamKeyInput: {
75
     streamKeyInput: {
71
         alignSelf: 'stretch',
76
         alignSelf: 'stretch',
72
-        height: 50
77
+        borderColor: ColorPalette.lightGrey,
78
+        borderBottomWidth: 1,
79
+        color: ColorPalette.white,
80
+        height: 40,
81
+        marginBottom: 5
73
     },
82
     },
74
 
83
 
75
     /**
84
     /**
76
      * Label for the previous field.
85
      * Label for the previous field.
77
      */
86
      */
78
     streamKeyInputLabel: {
87
     streamKeyInputLabel: {
79
-        alignSelf: 'flex-start'
88
+        alignSelf: 'flex-start',
89
+        color: ColorPalette.white
80
     },
90
     },
81
 
91
 
82
     /**
92
     /**
108
      * Additional style for the selected item.
118
      * Additional style for the selected item.
109
      */
119
      */
110
     streamKeyPickerItemHighlight: {
120
     streamKeyPickerItemHighlight: {
111
-        backgroundColor: ColorPalette.lighterGrey
121
+        backgroundColor: ColorPalette.darkGrey
112
     },
122
     },
113
 
123
 
114
     /**
124
     /**
119
         borderRadius: 3,
129
         borderRadius: 3,
120
         borderWidth: 1,
130
         borderWidth: 1,
121
         flexDirection: 'column'
131
         flexDirection: 'column'
132
+    },
133
+
134
+    text: {
135
+        color: ColorPalette.white
122
     }
136
     }
123
 
137
 
124
 });
138
 });

+ 34
- 23
react/features/recording/components/LiveStream/web/StartLiveStreamDialog.js 查看文件

4
 import React from 'react';
4
 import React from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
+import { Dialog } from '../../../../base/dialog';
7
 import { translate } from '../../../../base/i18n';
8
 import { translate } from '../../../../base/i18n';
8
 
9
 
9
 import {
10
 import {
59
         this._onRequestGoogleSignIn = this._onRequestGoogleSignIn.bind(this);
60
         this._onRequestGoogleSignIn = this._onRequestGoogleSignIn.bind(this);
60
         this._onYouTubeBroadcastIDSelected
61
         this._onYouTubeBroadcastIDSelected
61
             = this._onYouTubeBroadcastIDSelected.bind(this);
62
             = this._onYouTubeBroadcastIDSelected.bind(this);
62
-
63
-        this._renderDialogContent = this._renderDialogContent.bind(this);
64
     }
63
     }
65
 
64
 
66
     /**
65
     /**
78
         }
77
         }
79
     }
78
     }
80
 
79
 
80
+    /**
81
+     * Implements {@code Component}'s render.
82
+     *
83
+     * @inheritdoc
84
+     */
85
+    render() {
86
+        const { _googleApiApplicationClientID } = this.props;
87
+
88
+        return (
89
+            <Dialog
90
+                cancelTitleKey = 'dialog.Cancel'
91
+                okTitleKey = 'dialog.startLiveStreaming'
92
+                onCancel = { this._onCancel }
93
+                onSubmit = { this._onSubmit }
94
+                titleKey = 'liveStreaming.start'
95
+                width = { 'small' }>
96
+                <div className = 'live-stream-dialog'>
97
+                    { _googleApiApplicationClientID
98
+                        ? this._renderYouTubePanel() : null }
99
+                    <StreamKeyForm
100
+                        onChange = { this._onStreamKeyChange }
101
+                        value = {
102
+                            this.state.streamKey || this.props._streamKey
103
+                        } />
104
+                </div>
105
+            </Dialog>
106
+        );
107
+    }
108
+
109
+    _onCancel: () => boolean;
110
+
111
+    _onSubmit: () => boolean;
112
+
81
     _onInitializeGoogleApi: () => Promise<*>;
113
     _onInitializeGoogleApi: () => Promise<*>;
82
 
114
 
83
     /**
115
     /**
221
         });
253
         });
222
     }
254
     }
223
 
255
 
224
-    _renderDialogContent: () => React$Component<*>
225
-
226
-    /**
227
-     * Renders the platform specific dialog content.
228
-     *
229
-     * @returns {React$Component}
230
-     */
231
-    _renderDialogContent() {
232
-        const { _googleApiApplicationClientID } = this.props;
233
-
234
-        return (
235
-            <div className = 'live-stream-dialog'>
236
-                { _googleApiApplicationClientID
237
-                    ? this._renderYouTubePanel() : null }
238
-                <StreamKeyForm
239
-                    onChange = { this._onStreamKeyChange }
240
-                    value = { this.state.streamKey || this.props._streamKey } />
241
-            </div>
242
-        );
243
-    }
244
-
245
     /**
256
     /**
246
      * Renders a React Element for authenticating with the Google web client.
257
      * Renders a React Element for authenticating with the Google web client.
247
      *
258
      *

+ 16
- 3
react/features/recording/components/LiveStream/web/StopLiveStreamDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import React from 'react';
3
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
4
 
5
 
6
+import { Dialog } from '../../../../base/dialog';
5
 import { translate } from '../../../../base/i18n';
7
 import { translate } from '../../../../base/i18n';
6
 
8
 
7
 import AbstractStopLiveStreamDialog, {
9
 import AbstractStopLiveStreamDialog, {
17
 class StopLiveStreamDialog extends AbstractStopLiveStreamDialog {
19
 class StopLiveStreamDialog extends AbstractStopLiveStreamDialog {
18
 
20
 
19
     /**
21
     /**
20
-     * Renders the platform specific {@code Dialog} content.
22
+     * Implements React's {@link Component#render()}.
21
      *
23
      *
22
      * @inheritdoc
24
      * @inheritdoc
25
+     * @returns {ReactElement}
23
      */
26
      */
24
-    _renderDialogContent() {
25
-        return this.props.t('dialog.stopStreamingWarning');
27
+    render() {
28
+        return (
29
+            <Dialog
30
+                okTitleKey = 'dialog.stopLiveStreaming'
31
+                onSubmit = { this._onSubmit }
32
+                titleKey = 'dialog.liveStreaming'
33
+                width = 'small'>
34
+                { this.props.t('dialog.stopStreamingWarning') }
35
+            </Dialog>
36
+        );
26
     }
37
     }
38
+
39
+    _onSubmit: () => boolean;
27
 }
40
 }
28
 
41
 
29
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));
42
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));

+ 1
- 2
react/features/recording/components/Recording/AbstractRecordButton.js 查看文件

18
 
18
 
19
 import { getActiveSession } from '../../functions';
19
 import { getActiveSession } from '../../functions';
20
 
20
 
21
-import StartRecordingDialog from './StartRecordingDialog';
22
-import { StopRecordingDialog } from './_';
21
+import { StartRecordingDialog, StopRecordingDialog } from './_';
23
 
22
 
24
 /**
23
 /**
25
  * The type of the React {@code Component} props of
24
  * The type of the React {@code Component} props of

react/features/recording/components/Recording/StartRecordingDialog.js → react/features/recording/components/Recording/AbstractStartRecordingDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React, { Component } from 'react';
4
-import { connect } from 'react-redux';
3
+import { Component } from 'react';
5
 
4
 
6
 import {
5
 import {
7
     createRecordingDialogEvent,
6
     createRecordingDialogEvent,
8
     sendAnalytics
7
     sendAnalytics
9
 } from '../../../analytics';
8
 } from '../../../analytics';
10
-import { Dialog } from '../../../base/dialog';
11
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
12
 import {
10
 import {
13
     getDropboxData,
11
     getDropboxData,
14
     isEnabled as isDropboxEnabled
12
     isEnabled as isDropboxEnabled
15
 } from '../../../dropbox';
13
 } from '../../../dropbox';
16
 
14
 
17
-import StartRecordingDialogContent from './StartRecordingDialogContent';
18
-
19
 type Props = {
15
 type Props = {
20
 
16
 
21
     /**
17
     /**
75
 /**
71
 /**
76
  * Component for the recording start dialog.
72
  * Component for the recording start dialog.
77
  */
73
  */
78
-class StartRecordingDialog extends Component<Props, State> {
74
+class AbstractStartRecordingDialog extends Component<Props, State> {
79
     /**
75
     /**
80
      * Initializes a new {@code StartRecordingDialog} instance.
76
      * Initializes a new {@code StartRecordingDialog} instance.
81
      *
77
      *
93
             userName: undefined,
89
             userName: undefined,
94
             spaceLeft: undefined
90
             spaceLeft: undefined
95
         };
91
         };
92
+
93
+        this._onSubmit = this._onSubmit.bind(this);
96
     }
94
     }
97
 
95
 
98
     /**
96
     /**
113
      * @inheritdoc
111
      * @inheritdoc
114
      * @returns {void}
112
      * @returns {void}
115
      */
113
      */
116
-    componentDidUpdate(prevProps) {
114
+    componentDidUpdate(prevProps: Props) {
117
         if (this.props._token !== prevProps._token) {
115
         if (this.props._token !== prevProps._token) {
118
             this._onTokenUpdated();
116
             this._onTokenUpdated();
119
         }
117
         }
158
         }
156
         }
159
     }
157
     }
160
 
158
 
161
-    /**
162
-     * Implements React's {@link Component#render()}.
163
-     *
164
-     * @inheritdoc
165
-     * @returns {ReactElement}
166
-     */
167
-    render() {
168
-        const { isTokenValid, isValidating, spaceLeft, userName } = this.state;
169
-        const { _isDropboxEnabled } = this.props;
170
-
171
-        return (
172
-            <Dialog
173
-                okDisabled = { !isTokenValid && _isDropboxEnabled }
174
-                okTitleKey = 'dialog.confirm'
175
-                onSubmit = { this._onSubmit }
176
-                titleKey = 'dialog.recording'
177
-                width = 'small'>
178
-                <StartRecordingDialogContent
179
-                    integrationsEnabled = { _isDropboxEnabled }
180
-                    isTokenValid = { isTokenValid }
181
-                    isValidating = { isValidating }
182
-                    spaceLeft = { spaceLeft }
183
-                    userName = { userName } />
184
-            </Dialog>
185
-        );
186
-    }
187
-
188
     _onSubmit: () => boolean;
159
     _onSubmit: () => boolean;
189
 
160
 
190
     /**
161
     /**
240
  *     _token: string
211
  *     _token: string
241
  * }}
212
  * }}
242
  */
213
  */
243
-function mapStateToProps(state: Object) {
214
+export function mapStateToProps(state: Object) {
244
     const { dropbox = {} } = state['features/base/config'];
215
     const { dropbox = {} } = state['features/base/config'];
245
 
216
 
246
     return {
217
     return {
251
     };
222
     };
252
 }
223
 }
253
 
224
 
254
-export default connect(mapStateToProps)(StartRecordingDialog);
225
+export default AbstractStartRecordingDialog;

+ 1
- 28
react/features/recording/components/Recording/AbstractStopRecordingDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4
 
4
 
5
 import {
5
 import {
6
     createRecordingDialogEvent,
6
     createRecordingDialogEvent,
7
     sendAnalytics
7
     sendAnalytics
8
 } from '../../../analytics';
8
 } from '../../../analytics';
9
-import { Dialog } from '../../../base/dialog';
10
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
11
 
10
 
12
 import { getActiveSession } from '../../functions';
11
 import { getActiveSession } from '../../functions';
53
         this._onSubmit = this._onSubmit.bind(this);
52
         this._onSubmit = this._onSubmit.bind(this);
54
     }
53
     }
55
 
54
 
56
-    /**
57
-     * Implements React's {@link Component#render()}.
58
-     *
59
-     * @inheritdoc
60
-     * @returns {ReactElement}
61
-     */
62
-    render() {
63
-        return (
64
-            <Dialog
65
-                okTitleKey = 'dialog.confirm'
66
-                onSubmit = { this._onSubmit }
67
-                titleKey = 'dialog.recording'
68
-                width = 'small'>
69
-                { this._renderDialogContent() }
70
-            </Dialog>
71
-        );
72
-    }
73
-
74
     _onSubmit: () => boolean;
55
     _onSubmit: () => boolean;
75
 
56
 
76
     /**
57
     /**
90
 
71
 
91
         return true;
72
         return true;
92
     }
73
     }
93
-
94
-    /**
95
-     * Renders the platform specific dialog content.
96
-     *
97
-     * @protected
98
-     * @returns {React$Component}
99
-     */
100
-    _renderDialogContent: () => React$Component<*>
101
 }
74
 }
102
 
75
 
103
 /**
76
 /**

+ 7
- 5
react/features/recording/components/Recording/StartRecordingDialogContent.js 查看文件

85
      * @returns {React$Component}
85
      * @returns {React$Component}
86
      */
86
      */
87
     render() {
87
     render() {
88
-        if (this.props.integrationsEnabled) {
88
+        if (this.props.integrationsEnabled === true) { // explicit true needed
89
             return this._renderIntegrationsContent();
89
             return this._renderIntegrationsContent();
90
         }
90
         }
91
 
91
 
99
      */
99
      */
100
     _renderNoIntegrationsContent() {
100
     _renderNoIntegrationsContent() {
101
         return (
101
         return (
102
-            <DialogContent>
102
+            <DialogContent style = { styles.noIntegrationContent }>
103
                 { this.props.t('recording.startRecordingBody') }
103
                 { this.props.t('recording.startRecordingBody') }
104
             </DialogContent>
104
             </DialogContent>
105
         );
105
         );
195
                     className = 'logged-in-panel'
195
                     className = 'logged-in-panel'
196
                     style = { styles.loggedIn }>
196
                     style = { styles.loggedIn }>
197
                     <Container>
197
                     <Container>
198
-                        <Text>
198
+                        <Text style = { styles.text }>
199
                             { t('recording.loggedIn', { userName }) }
199
                             { t('recording.loggedIn', { userName }) }
200
                         </Text>
200
                         </Text>
201
                     </Container>
201
                     </Container>
202
                     <Container>
202
                     <Container>
203
-                        <Text>
203
+                        <Text style = { styles.text }>
204
                             {
204
                             {
205
                                 t('recording.availableSpace', {
205
                                 t('recording.availableSpace', {
206
                                     spaceLeft,
206
                                     spaceLeft,
211
                     </Container>
211
                     </Container>
212
                 </Container>
212
                 </Container>
213
                 <Container style = { styles.startRecordingText }>
213
                 <Container style = { styles.startRecordingText }>
214
-                    <Text>{ t('recording.startRecordingBody') }</Text>
214
+                    <Text style = { styles.text }>
215
+                        { t('recording.startRecordingBody') }
216
+                    </Text>
215
                 </Container>
217
                 </Container>
216
             </Container>
218
             </Container>
217
         );
219
         );

+ 54
- 0
react/features/recording/components/Recording/native/StartRecordingDialog.js 查看文件

1
+// @flow
2
+
3
+import React from 'react';
4
+import { connect } from 'react-redux';
5
+
6
+import { translate } from '../../../../base/i18n';
7
+import { ConfirmDialog, CustomSubmitDialog } from '../../../../base/dialog';
8
+
9
+import AbstractStartRecordingDialog, {
10
+    mapStateToProps
11
+} from '../AbstractStartRecordingDialog';
12
+import StartRecordingDialogContent from '../StartRecordingDialogContent';
13
+
14
+/**
15
+ * React Component for getting confirmation to start a file recording session in
16
+ * progress.
17
+ *
18
+ * @extends Component
19
+ */
20
+class StartRecordingDialog extends AbstractStartRecordingDialog {
21
+    /**
22
+     * Implements React's {@link Component#render()}.
23
+     *
24
+     * @inheritdoc
25
+     */
26
+    render() {
27
+        const { isTokenValid, isValidating, spaceLeft, userName } = this.state;
28
+        const { _isDropboxEnabled } = this.props;
29
+
30
+        if (!_isDropboxEnabled) {
31
+            return (
32
+                <ConfirmDialog
33
+                    contentKey = 'recording.startRecordingBody'
34
+                    onSubmit = { this._onSubmit } />
35
+            );
36
+        }
37
+
38
+        return (
39
+            <CustomSubmitDialog
40
+                okDisabled = { !isTokenValid }
41
+                onSubmit = { this._onSubmit } >
42
+                <StartRecordingDialogContent
43
+                    isTokenValid = { isTokenValid }
44
+                    isValidating = { isValidating }
45
+                    spaceLeft = { spaceLeft }
46
+                    userName = { userName } />
47
+            </CustomSubmitDialog>
48
+        );
49
+    }
50
+
51
+    _onSubmit: () => boolean
52
+}
53
+
54
+export default translate(connect(mapStateToProps)(StartRecordingDialog));

+ 8
- 8
react/features/recording/components/Recording/native/StopRecordingDialog.js 查看文件

3
 import React from 'react';
3
 import React from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
-import { DialogContent } from '../../../../base/dialog';
6
+import { ConfirmDialog } from '../../../../base/dialog';
7
 import { translate } from '../../../../base/i18n';
7
 import { translate } from '../../../../base/i18n';
8
 
8
 
9
 import AbstractStopRecordingDialog, {
9
 import AbstractStopRecordingDialog, {
20
 class StopRecordingDialog extends AbstractStopRecordingDialog<Props> {
20
 class StopRecordingDialog extends AbstractStopRecordingDialog<Props> {
21
 
21
 
22
     /**
22
     /**
23
-     * Renders the platform specific dialog content.
23
+     * Implements {@code Component#render}.
24
      *
24
      *
25
      * @inheritdoc
25
      * @inheritdoc
26
      */
26
      */
27
-    _renderDialogContent() {
28
-        const { t } = this.props;
29
-
27
+    render() {
30
         return (
28
         return (
31
-            <DialogContent>
32
-                { t('dialog.stopRecordingWarning') }
33
-            </DialogContent>
29
+            <ConfirmDialog
30
+                contentKey = 'dialog.stopRecordingWarning'
31
+                onSubmit = { this._onSubmit } />
34
         );
32
         );
35
     }
33
     }
34
+
35
+    _onSubmit: () => boolean
36
 }
36
 }
37
 
37
 
38
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));
38
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));

+ 1
- 0
react/features/recording/components/Recording/native/index.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 export { default as RecordButton } from './RecordButton';
3
 export { default as RecordButton } from './RecordButton';
4
+export { default as StartRecordingDialog } from './StartRecordingDialog';
4
 export { default as StopRecordingDialog } from './StopRecordingDialog';
5
 export { default as StopRecordingDialog } from './StopRecordingDialog';

+ 11
- 1
react/features/recording/components/Recording/styles.native.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { BoxModel, createStyleSheet } from '../../../base/styles';
3
+import { BoxModel, createStyleSheet, ColorPalette } from '../../../base/styles';
4
 
4
 
5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
6
 // the special case(s) of the recording feature bellow.
6
 // the special case(s) of the recording feature bellow.
28
         paddingBottom: _PADDING
28
         paddingBottom: _PADDING
29
     },
29
     },
30
 
30
 
31
+    noIntegrationContent: {
32
+        color: ColorPalette.white
33
+    },
34
+
31
     startRecordingText: {
35
     startRecordingText: {
32
         paddingBottom: _PADDING
36
         paddingBottom: _PADDING
33
     },
37
     },
34
 
38
 
35
     switch: {
39
     switch: {
40
+        color: ColorPalette.white,
36
         paddingRight: BoxModel.padding
41
         paddingRight: BoxModel.padding
37
     },
42
     },
38
 
43
 
39
     title: {
44
     title: {
45
+        color: ColorPalette.white,
40
         fontSize: 16,
46
         fontSize: 16,
41
         fontWeight: 'bold'
47
         fontWeight: 'bold'
48
+    },
49
+
50
+    text: {
51
+        color: ColorPalette.white
42
     }
52
     }
43
 });
53
 });

+ 50
- 0
react/features/recording/components/Recording/web/StartRecordingDialog.js 查看文件

1
+// @flow
2
+
3
+import React from 'react';
4
+import { connect } from 'react-redux';
5
+
6
+import { translate } from '../../../../base/i18n';
7
+import { Dialog } from '../../../../base/dialog';
8
+
9
+import AbstractStartRecordingDialog, {
10
+    mapStateToProps
11
+} from '../AbstractStartRecordingDialog';
12
+import StartRecordingDialogContent from '../StartRecordingDialogContent';
13
+
14
+/**
15
+ * React Component for getting confirmation to start a file recording session in
16
+ * progress.
17
+ *
18
+ * @extends Component
19
+ */
20
+class StartRecordingDialog extends AbstractStartRecordingDialog {
21
+    /**
22
+     * Implements React's {@link Component#render()}.
23
+     *
24
+     * @inheritdoc
25
+     */
26
+    render() {
27
+        const { isTokenValid, isValidating, spaceLeft, userName } = this.state;
28
+        const { _isDropboxEnabled } = this.props;
29
+
30
+        return (
31
+            <Dialog
32
+                okDisabled = { !isTokenValid && _isDropboxEnabled }
33
+                okTitleKey = 'dialog.confirm'
34
+                onSubmit = { this._onSubmit }
35
+                titleKey = 'dialog.recording'
36
+                width = 'small'>
37
+                <StartRecordingDialogContent
38
+                    integrationsEnabled = { _isDropboxEnabled }
39
+                    isTokenValid = { isTokenValid }
40
+                    isValidating = { isValidating }
41
+                    spaceLeft = { spaceLeft }
42
+                    userName = { userName } />
43
+            </Dialog>
44
+        );
45
+    }
46
+
47
+    _onSubmit: () => boolean
48
+}
49
+
50
+export default translate(connect(mapStateToProps)(StartRecordingDialog));

+ 15
- 6
react/features/recording/components/Recording/web/StopRecordingDialog.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import React from 'react';
3
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
4
 
5
 
5
 import { translate } from '../../../../base/i18n';
6
 import { translate } from '../../../../base/i18n';
7
+import { Dialog } from '../../../../base/dialog';
6
 
8
 
7
 import AbstractStopRecordingDialog, {
9
 import AbstractStopRecordingDialog, {
8
     type Props,
10
     type Props,
16
  * @extends Component
18
  * @extends Component
17
  */
19
  */
18
 class StopRecordingDialog extends AbstractStopRecordingDialog<Props> {
20
 class StopRecordingDialog extends AbstractStopRecordingDialog<Props> {
19
-
20
     /**
21
     /**
21
-     * Renders the platform specific dialog content.
22
+     * Implements React's {@link Component#render()}.
22
      *
23
      *
23
-     * @protected
24
-     * @returns {React$Component}
24
+     * @inheritdoc
25
+     * @returns {ReactElement}
25
      */
26
      */
26
-    _renderDialogContent() {
27
+    render() {
27
         const { t } = this.props;
28
         const { t } = this.props;
28
 
29
 
29
         return (
30
         return (
30
-            t('dialog.stopRecordingWarning')
31
+            <Dialog
32
+                okTitleKey = 'dialog.confirm'
33
+                onSubmit = { this._onSubmit }
34
+                titleKey = 'dialog.recording'
35
+                width = 'small'>
36
+                { t('dialog.stopRecordingWarning') }
37
+            </Dialog>
31
         );
38
         );
32
     }
39
     }
40
+
41
+    _onSubmit: () => boolean
33
 }
42
 }
34
 
43
 
35
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));
44
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));

+ 1
- 0
react/features/recording/components/Recording/web/index.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 export { default as RecordButton } from './RecordButton';
3
 export { default as RecordButton } from './RecordButton';
4
+export { default as StartRecordingDialog } from './StartRecordingDialog';
4
 export { default as StopRecordingDialog } from './StopRecordingDialog';
5
 export { default as StopRecordingDialog } from './StopRecordingDialog';

正在加载...
取消
保存