ソースを参照

[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,6 +3,7 @@
3 3
 import React, { Component } from 'react';
4 4
 
5 5
 import { Container, Text } from '../../react';
6
+import { type StyleType } from '../../styles';
6 7
 
7 8
 import styles from './styles';
8 9
 
@@ -11,7 +12,9 @@ type Props = {
11 12
     /**
12 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,10 +28,10 @@ export default class DialogContent extends Component<Props> {
25 28
      * @inheritdoc
26 29
      */
27 30
     render() {
28
-        const { children } = this.props;
31
+        const { children, style } = this.props;
29 32
 
30 33
         const childrenComponent = typeof children === 'string'
31
-            ? <Text>{ children }</Text>
34
+            ? <Text style = { style }>{ children }</Text>
32 35
             : children;
33 36
 
34 37
         return (

+ 1
- 0
react/features/google-api/components/styles.js ファイルの表示

@@ -38,6 +38,7 @@ export default createStyleSheet({
38 38
         borderColor: ColorPalette.lightGrey,
39 39
         borderRadius: 3,
40 40
         borderWidth: 1,
41
+        color: ColorPalette.white,
41 42
         height: BUTTON_HEIGHT,
42 43
         justifyContent: 'center'
43 44
     },

+ 1
- 30
react/features/recording/components/LiveStream/AbstractStartLiveStreamDialog.js ファイルの表示

@@ -1,12 +1,11 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4 4
 
5 5
 import {
6 6
     createRecordingDialogEvent,
7 7
     sendAnalytics
8 8
 } from '../../../analytics';
9
-import { Dialog } from '../../../base/dialog';
10 9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
11 10
 
12 11
 /**
@@ -140,27 +139,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
140 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 142
     _onCancel: () => boolean;
165 143
 
166 144
     /**
@@ -257,13 +235,6 @@ export default class AbstractStartLiveStreamDialog<P: Props>
257 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,8 +1,7 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4 4
 
5
-import { Dialog } from '../../../base/dialog';
6 5
 import {
7 6
     createRecordingDialogEvent,
8 7
     sendAnalytics
@@ -53,24 +52,6 @@ export default class AbstractStopLiveStreamDialog extends Component<Props> {
53 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 55
     _onSubmit: () => boolean;
75 56
 
76 57
     /**
@@ -90,14 +71,6 @@ export default class AbstractStopLiveStreamDialog extends Component<Props> {
90 71
 
91 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,14 +126,16 @@ class GoogleSigninForm extends Component<Props> {
126 126
             return null;
127 127
         }
128 128
 
129
+        const userInfo = signedInUser
130
+            ? `${t('liveStreaming.signedInAs')} ${signedInUser}`
131
+            : t('liveStreaming.signInCTA');
132
+
129 133
         return (
130 134
             <View style = { styles.formWrapper }>
131 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 139
                 </View>
138 140
                 <GoogleSignInButton
139 141
                     onClick = { this._onGoogleButtonPress }

+ 32
- 24
react/features/recording/components/LiveStream/native/StartLiveStreamDialog.js ファイルの表示

@@ -4,6 +4,7 @@ import React from 'react';
4 4
 import { View } from 'react-native';
5 5
 import { connect } from 'react-redux';
6 6
 
7
+import { CustomSubmitDialog } from '../../../../base/dialog';
7 8
 import { translate } from '../../../../base/i18n';
8 9
 import { googleApi } from '../../../../google-api';
9 10
 
@@ -36,9 +37,39 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
36 37
             = this._onStreamKeyChangeNative.bind(this);
37 38
         this._onStreamKeyPick = this._onStreamKeyPick.bind(this);
38 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 73
     _onStreamKeyChange: string => void
43 74
 
44 75
     _onStreamKeyChangeNative: string => void;
@@ -102,29 +133,6 @@ class StartLiveStreamDialog extends AbstractStartLiveStreamDialog<Props> {
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 138
 export default translate(connect(_mapStateToProps)(StartLiveStreamDialog));

+ 9
- 8
react/features/recording/components/LiveStream/native/StopLiveStreamDialog.js ファイルの表示

@@ -3,7 +3,7 @@
3 3
 import React from 'react';
4 4
 import { connect } from 'react-redux';
5 5
 
6
-import { DialogContent } from '../../../../base/dialog';
6
+import { ConfirmDialog } from '../../../../base/dialog';
7 7
 import { translate } from '../../../../base/i18n';
8 8
 
9 9
 import AbstractStopLiveStreamDialog, {
@@ -19,19 +19,20 @@ import AbstractStopLiveStreamDialog, {
19 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 24
      * @inheritdoc
25
+     * @returns {ReactElement}
25 26
      */
26
-    _renderDialogContent() {
27
+    render() {
27 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 38
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));

+ 3
- 2
react/features/recording/components/LiveStream/native/StreamKeyForm.js ファイルの表示

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

+ 2
- 2
react/features/recording/components/LiveStream/native/StreamKeyPicker.js ファイルの表示

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

+ 17
- 3
react/features/recording/components/LiveStream/native/styles.js ファイルの表示

@@ -11,6 +11,11 @@ import {
11 11
  */
12 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 20
  * Underlay of the TouchableHighlight.
16 21
  */
@@ -69,14 +74,19 @@ export default createStyleSheet({
69 74
      */
70 75
     streamKeyInput: {
71 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 85
      * Label for the previous field.
77 86
      */
78 87
     streamKeyInputLabel: {
79
-        alignSelf: 'flex-start'
88
+        alignSelf: 'flex-start',
89
+        color: ColorPalette.white
80 90
     },
81 91
 
82 92
     /**
@@ -108,7 +118,7 @@ export default createStyleSheet({
108 118
      * Additional style for the selected item.
109 119
      */
110 120
     streamKeyPickerItemHighlight: {
111
-        backgroundColor: ColorPalette.lighterGrey
121
+        backgroundColor: ColorPalette.darkGrey
112 122
     },
113 123
 
114 124
     /**
@@ -119,6 +129,10 @@ export default createStyleSheet({
119 129
         borderRadius: 3,
120 130
         borderWidth: 1,
121 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,6 +4,7 @@ import Spinner from '@atlaskit/spinner';
4 4
 import React from 'react';
5 5
 import { connect } from 'react-redux';
6 6
 
7
+import { Dialog } from '../../../../base/dialog';
7 8
 import { translate } from '../../../../base/i18n';
8 9
 
9 10
 import {
@@ -59,8 +60,6 @@ class StartLiveStreamDialog
59 60
         this._onRequestGoogleSignIn = this._onRequestGoogleSignIn.bind(this);
60 61
         this._onYouTubeBroadcastIDSelected
61 62
             = this._onYouTubeBroadcastIDSelected.bind(this);
62
-
63
-        this._renderDialogContent = this._renderDialogContent.bind(this);
64 63
     }
65 64
 
66 65
     /**
@@ -78,6 +77,39 @@ class StartLiveStreamDialog
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 113
     _onInitializeGoogleApi: () => Promise<*>;
82 114
 
83 115
     /**
@@ -221,27 +253,6 @@ class StartLiveStreamDialog
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 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,7 +1,9 @@
1 1
 // @flow
2 2
 
3
+import React from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
6
+import { Dialog } from '../../../../base/dialog';
5 7
 import { translate } from '../../../../base/i18n';
6 8
 
7 9
 import AbstractStopLiveStreamDialog, {
@@ -17,13 +19,24 @@ import AbstractStopLiveStreamDialog, {
17 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 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 42
 export default translate(connect(_mapStateToProps)(StopLiveStreamDialog));

+ 1
- 2
react/features/recording/components/Recording/AbstractRecordButton.js ファイルの表示

@@ -18,8 +18,7 @@ import {
18 18
 
19 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 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,21 +1,17 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
4
-import { connect } from 'react-redux';
3
+import { Component } from 'react';
5 4
 
6 5
 import {
7 6
     createRecordingDialogEvent,
8 7
     sendAnalytics
9 8
 } from '../../../analytics';
10
-import { Dialog } from '../../../base/dialog';
11 9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
12 10
 import {
13 11
     getDropboxData,
14 12
     isEnabled as isDropboxEnabled
15 13
 } from '../../../dropbox';
16 14
 
17
-import StartRecordingDialogContent from './StartRecordingDialogContent';
18
-
19 15
 type Props = {
20 16
 
21 17
     /**
@@ -75,7 +71,7 @@ type State = {
75 71
 /**
76 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 76
      * Initializes a new {@code StartRecordingDialog} instance.
81 77
      *
@@ -93,6 +89,8 @@ class StartRecordingDialog extends Component<Props, State> {
93 89
             userName: undefined,
94 90
             spaceLeft: undefined
95 91
         };
92
+
93
+        this._onSubmit = this._onSubmit.bind(this);
96 94
     }
97 95
 
98 96
     /**
@@ -113,7 +111,7 @@ class StartRecordingDialog extends Component<Props, State> {
113 111
      * @inheritdoc
114 112
      * @returns {void}
115 113
      */
116
-    componentDidUpdate(prevProps) {
114
+    componentDidUpdate(prevProps: Props) {
117 115
         if (this.props._token !== prevProps._token) {
118 116
             this._onTokenUpdated();
119 117
         }
@@ -158,33 +156,6 @@ class StartRecordingDialog extends Component<Props, State> {
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 159
     _onSubmit: () => boolean;
189 160
 
190 161
     /**
@@ -240,7 +211,7 @@ class StartRecordingDialog extends Component<Props, State> {
240 211
  *     _token: string
241 212
  * }}
242 213
  */
243
-function mapStateToProps(state: Object) {
214
+export function mapStateToProps(state: Object) {
244 215
     const { dropbox = {} } = state['features/base/config'];
245 216
 
246 217
     return {
@@ -251,4 +222,4 @@ function mapStateToProps(state: Object) {
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,12 +1,11 @@
1 1
 // @flow
2 2
 
3
-import React, { Component } from 'react';
3
+import { Component } from 'react';
4 4
 
5 5
 import {
6 6
     createRecordingDialogEvent,
7 7
     sendAnalytics
8 8
 } from '../../../analytics';
9
-import { Dialog } from '../../../base/dialog';
10 9
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
11 10
 
12 11
 import { getActiveSession } from '../../functions';
@@ -53,24 +52,6 @@ export default class AbstractStopRecordingDialog<P: Props>
53 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 55
     _onSubmit: () => boolean;
75 56
 
76 57
     /**
@@ -90,14 +71,6 @@ export default class AbstractStopRecordingDialog<P: Props>
90 71
 
91 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,7 +85,7 @@ class StartRecordingDialogContent extends Component<Props> {
85 85
      * @returns {React$Component}
86 86
      */
87 87
     render() {
88
-        if (this.props.integrationsEnabled) {
88
+        if (this.props.integrationsEnabled === true) { // explicit true needed
89 89
             return this._renderIntegrationsContent();
90 90
         }
91 91
 
@@ -99,7 +99,7 @@ class StartRecordingDialogContent extends Component<Props> {
99 99
      */
100 100
     _renderNoIntegrationsContent() {
101 101
         return (
102
-            <DialogContent>
102
+            <DialogContent style = { styles.noIntegrationContent }>
103 103
                 { this.props.t('recording.startRecordingBody') }
104 104
             </DialogContent>
105 105
         );
@@ -195,12 +195,12 @@ class StartRecordingDialogContent extends Component<Props> {
195 195
                     className = 'logged-in-panel'
196 196
                     style = { styles.loggedIn }>
197 197
                     <Container>
198
-                        <Text>
198
+                        <Text style = { styles.text }>
199 199
                             { t('recording.loggedIn', { userName }) }
200 200
                         </Text>
201 201
                     </Container>
202 202
                     <Container>
203
-                        <Text>
203
+                        <Text style = { styles.text }>
204 204
                             {
205 205
                                 t('recording.availableSpace', {
206 206
                                     spaceLeft,
@@ -211,7 +211,9 @@ class StartRecordingDialogContent extends Component<Props> {
211 211
                     </Container>
212 212
                 </Container>
213 213
                 <Container style = { styles.startRecordingText }>
214
-                    <Text>{ t('recording.startRecordingBody') }</Text>
214
+                    <Text style = { styles.text }>
215
+                        { t('recording.startRecordingBody') }
216
+                    </Text>
215 217
                 </Container>
216 218
             </Container>
217 219
         );

+ 54
- 0
react/features/recording/components/Recording/native/StartRecordingDialog.js ファイルの表示

@@ -0,0 +1,54 @@
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,7 +3,7 @@
3 3
 import React from 'react';
4 4
 import { connect } from 'react-redux';
5 5
 
6
-import { DialogContent } from '../../../../base/dialog';
6
+import { ConfirmDialog } from '../../../../base/dialog';
7 7
 import { translate } from '../../../../base/i18n';
8 8
 
9 9
 import AbstractStopRecordingDialog, {
@@ -20,19 +20,19 @@ import AbstractStopRecordingDialog, {
20 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 25
      * @inheritdoc
26 26
      */
27
-    _renderDialogContent() {
28
-        const { t } = this.props;
29
-
27
+    render() {
30 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 38
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));

+ 1
- 0
react/features/recording/components/Recording/native/index.js ファイルの表示

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

+ 11
- 1
react/features/recording/components/Recording/styles.native.js ファイルの表示

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import { BoxModel, createStyleSheet } from '../../../base/styles';
3
+import { BoxModel, createStyleSheet, ColorPalette } from '../../../base/styles';
4 4
 
5 5
 // XXX The "standard" {@code BoxModel.padding} has been deemed insufficient in
6 6
 // the special case(s) of the recording feature bellow.
@@ -28,16 +28,26 @@ export default createStyleSheet({
28 28
         paddingBottom: _PADDING
29 29
     },
30 30
 
31
+    noIntegrationContent: {
32
+        color: ColorPalette.white
33
+    },
34
+
31 35
     startRecordingText: {
32 36
         paddingBottom: _PADDING
33 37
     },
34 38
 
35 39
     switch: {
40
+        color: ColorPalette.white,
36 41
         paddingRight: BoxModel.padding
37 42
     },
38 43
 
39 44
     title: {
45
+        color: ColorPalette.white,
40 46
         fontSize: 16,
41 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 ファイルの表示

@@ -0,0 +1,50 @@
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,8 +1,10 @@
1 1
 // @flow
2 2
 
3
+import React from 'react';
3 4
 import { connect } from 'react-redux';
4 5
 
5 6
 import { translate } from '../../../../base/i18n';
7
+import { Dialog } from '../../../../base/dialog';
6 8
 
7 9
 import AbstractStopRecordingDialog, {
8 10
     type Props,
@@ -16,20 +18,27 @@ import AbstractStopRecordingDialog, {
16 18
  * @extends Component
17 19
  */
18 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 28
         const { t } = this.props;
28 29
 
29 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 44
 export default translate(connect(_mapStateToProps)(StopRecordingDialog));

+ 1
- 0
react/features/recording/components/Recording/web/index.js ファイルの表示

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

読み込み中…
キャンセル
保存