|
@@ -7,9 +7,17 @@ import { connect } from '../../base/redux';
|
7
|
7
|
import {
|
8
|
8
|
_abstractMapStateToProps,
|
9
|
9
|
AbstractCaptions,
|
10
|
|
- type AbstractCaptionsProps as Props
|
|
10
|
+ type AbstractCaptionsProps
|
11
|
11
|
} from './AbstractCaptions';
|
12
|
12
|
|
|
13
|
+type Props = {
|
|
14
|
+
|
|
15
|
+ /**
|
|
16
|
+ * Whether the subtitles container is lifted above the invite box.
|
|
17
|
+ */
|
|
18
|
+ _isLifted: boolean
|
|
19
|
+} & AbstractCaptionsProps;
|
|
20
|
+
|
13
|
21
|
/**
|
14
|
22
|
* React {@code Component} which can display speech-to-text results from
|
15
|
23
|
* Jigasi as subtitles.
|
|
@@ -45,12 +53,30 @@ class Captions
|
45
|
53
|
*/
|
46
|
54
|
_renderSubtitlesContainer(
|
47
|
55
|
paragraphs: Array<React$Element<*>>): React$Element<*> {
|
|
56
|
+
|
|
57
|
+ const className = this.props._isLifted ? 'transcription-subtitles lifted' : 'transcription-subtitles';
|
|
58
|
+
|
48
|
59
|
return (
|
49
|
|
- <div className = 'transcription-subtitles' >
|
|
60
|
+ <div className = { className } >
|
50
|
61
|
{ paragraphs }
|
51
|
62
|
</div>
|
52
|
63
|
);
|
53
|
64
|
}
|
54
|
65
|
}
|
55
|
66
|
|
56
|
|
-export default connect(_abstractMapStateToProps)(Captions);
|
|
67
|
+/**
|
|
68
|
+ * Maps (parts of) the redux state to the associated {@code }'s
|
|
69
|
+ * props.
|
|
70
|
+ *
|
|
71
|
+ * @param {Object} state - The redux state.
|
|
72
|
+ * @private
|
|
73
|
+ * @returns {Object}
|
|
74
|
+ */
|
|
75
|
+function mapStateToProps(state) {
|
|
76
|
+ return {
|
|
77
|
+ ..._abstractMapStateToProps(state),
|
|
78
|
+ _isLifted: state['features/base/participants'].length < 2
|
|
79
|
+ };
|
|
80
|
+}
|
|
81
|
+
|
|
82
|
+export default connect(mapStateToProps)(Captions);
|