|
|
@@ -8,6 +8,8 @@ import { Avatar } from '../../base/participants';
|
|
8
|
8
|
import { Container, Text } from '../../base/react';
|
|
9
|
9
|
import UIEvents from '../../../../service/UI/UIEvents';
|
|
10
|
10
|
|
|
|
11
|
+import styles from './styles';
|
|
|
12
|
+
|
|
11
|
13
|
declare var $: Object;
|
|
12
|
14
|
declare var APP: Object;
|
|
13
|
15
|
declare var interfaceConfig: Object;
|
|
|
@@ -160,17 +162,22 @@ class CallOverlay extends Component {
|
|
160
|
162
|
|
|
161
|
163
|
return (
|
|
162
|
164
|
<Container
|
|
163
|
|
- className = { `ringing ${className || ''}` }
|
|
|
165
|
+ { ...this._style('ringing', className) }
|
|
164
|
166
|
id = 'ringOverlay'>
|
|
165
|
|
- <Container className = 'ringing__content'>
|
|
166
|
|
- { ringing ? <Text>Calling...</Text> : null }
|
|
|
167
|
+ <Container
|
|
|
168
|
+ { ...this._style('ringing__content') }>
|
|
|
169
|
+ <Text { ...this._style('ringing__text') }>
|
|
|
170
|
+ { ringing ? 'Calling...' : '' }
|
|
|
171
|
+ </Text>
|
|
167
|
172
|
<Avatar
|
|
168
|
|
- className = 'ringing__avatar'
|
|
|
173
|
+ { ...this._style('ringing__avatar') }
|
|
169
|
174
|
uri = { avatarUrl } />
|
|
170
|
|
- <Container className = 'ringing__caller-info'>
|
|
171
|
|
- <Text>
|
|
|
175
|
+ <Container
|
|
|
176
|
+ { ...this._style('ringing__caller-info') }>
|
|
|
177
|
+ <Text
|
|
|
178
|
+ { ...this._style('ringing__text') }>
|
|
172
|
179
|
{ name }
|
|
173
|
|
- { ringing ? null : ' isn\'t available' }
|
|
|
180
|
+ { ringing ? '' : ' isn\'t available' }
|
|
174
|
181
|
</Text>
|
|
175
|
182
|
</Container>
|
|
176
|
183
|
</Container>
|
|
|
@@ -263,6 +270,52 @@ class CallOverlay extends Component {
|
|
263
|
270
|
_setAudio(audio) {
|
|
264
|
271
|
this._audio = audio;
|
|
265
|
272
|
}
|
|
|
273
|
+
|
|
|
274
|
+ /**
|
|
|
275
|
+ * Attempts to convert specified CSS class names into React
|
|
|
276
|
+ * {@link Component} props {@code style} or {@code className}.
|
|
|
277
|
+ *
|
|
|
278
|
+ * @param {Array<string>} classNames - The CSS class names to convert
|
|
|
279
|
+ * into React {@code Component} props {@code style} or {@code className}.
|
|
|
280
|
+ * @returns {{
|
|
|
281
|
+ * className: string,
|
|
|
282
|
+ * style: Object
|
|
|
283
|
+ * }}
|
|
|
284
|
+ */
|
|
|
285
|
+ _style(...classNames: Array<?string>) {
|
|
|
286
|
+ let className = '';
|
|
|
287
|
+ let style;
|
|
|
288
|
+
|
|
|
289
|
+ for (const aClassName of classNames) {
|
|
|
290
|
+ if (aClassName) {
|
|
|
291
|
+ // Attemp to convert aClassName into style.
|
|
|
292
|
+ if (styles && aClassName in styles) {
|
|
|
293
|
+ // React Native will accept an Array as the value of the
|
|
|
294
|
+ // style prop. However, I do not know about React.
|
|
|
295
|
+ style = {
|
|
|
296
|
+ ...style,
|
|
|
297
|
+ ...styles[aClassName]
|
|
|
298
|
+ };
|
|
|
299
|
+ } else {
|
|
|
300
|
+ // Otherwise, leave it as className.
|
|
|
301
|
+ className += aClassName;
|
|
|
302
|
+ }
|
|
|
303
|
+ }
|
|
|
304
|
+ }
|
|
|
305
|
+
|
|
|
306
|
+ // Choose which of the className and/or style props has a value and,
|
|
|
307
|
+ // consequently, must be returned.
|
|
|
308
|
+ const props = {};
|
|
|
309
|
+
|
|
|
310
|
+ if (className) {
|
|
|
311
|
+ props.className = className;
|
|
|
312
|
+ }
|
|
|
313
|
+ if (style) {
|
|
|
314
|
+ props.style = style;
|
|
|
315
|
+ }
|
|
|
316
|
+
|
|
|
317
|
+ return props;
|
|
|
318
|
+ }
|
|
266
|
319
|
}
|
|
267
|
320
|
|
|
268
|
321
|
/**
|