Ver código fonte

fix(presence-label):styles

j8
hristoterezov 6 anos atrás
pai
commit
9331b0870b

+ 0
- 1
css/_videolayout_default.scss Ver arquivo

@@ -627,7 +627,6 @@
627 627
     padding-left: 10px;
628 628
     padding-right: 10px;
629 629
 }
630
-#remotePresenceMessage .no-presence,
631 630
 #remoteConnectionMessage {
632 631
     display: none;
633 632
 }

+ 1
- 4
modules/UI/videolayout/LargeVideoManager.js Ver arquivo

@@ -429,11 +429,8 @@ export default class LargeVideoManager {
429 429
                 <Provider store = { APP.store }>
430 430
                     <I18nextProvider i18n = { i18next }>
431 431
                         <PresenceLabel
432
-                            noContentStyles = { {
433
-                                className: 'presence-label no-presence'
434
-                            } }
435 432
                             participantID = { id }
436
-                            styles = { { className: 'presence-label' } } />
433
+                            className = 'presence-label' />
437 434
                     </I18nextProvider>
438 435
                 </Provider>,
439 436
                 presenceLabelContainer.get(0));

+ 1
- 4
modules/UI/videolayout/RemoteVideo.js Ver arquivo

@@ -574,11 +574,8 @@ RemoteVideo.prototype.addPresenceLabel = function() {
574 574
             <Provider store = { APP.store }>
575 575
                 <I18nextProvider i18n = { i18next }>
576 576
                     <PresenceLabel
577
-                        noContentStyles = { {
578
-                            className: 'presence-label no-presence'
579
-                        } }
580 577
                         participantID = { this.id }
581
-                        styles = { { className: 'presence-label' } } />
578
+                        className = 'presence-label' />
582 579
                 </I18nextProvider>
583 580
             </Provider>,
584 581
             presenceLabelContainer);

+ 1
- 1
react/features/invite/components/callee-info/CalleeInfo.js Ver arquivo

@@ -64,7 +64,7 @@ class CalleeInfo extends Component<Props> {
64 64
                     <Container { ...this._style('ringing__status') }>
65 65
                         <PresenceLabel
66 66
                             defaultPresence = { status }
67
-                            styles = { this._style('ringing__text') } />
67
+                            { ...this._style('ringing__text') } />
68 68
                     </Container>
69 69
                     <Container { ...this._style('ringing__name') }>
70 70
                         <Text

+ 18
- 12
react/features/presence-status/components/PresenceLabel.js Ver arquivo

@@ -37,15 +37,15 @@ class PresenceLabel extends Component {
37 37
         _presence: PropTypes.string,
38 38
 
39 39
         /**
40
-         * Default presence status that will be displayed if user's presence
41
-         * status is not available.
40
+         * Class name for the presence label.
42 41
          */
43
-        defaultPresence: PropTypes.string,
42
+        className: PropTypes.string,
44 43
 
45 44
         /**
46
-         * Styles for the case where there isn't any content to be shown.
45
+         * Default presence status that will be displayed if user's presence
46
+         * status is not available.
47 47
          */
48
-        noContentStyles: PropTypes.object,
48
+        defaultPresence: PropTypes.string,
49 49
 
50 50
         /**
51 51
          * The ID of the participant whose presence status shoul display.
@@ -55,7 +55,7 @@ class PresenceLabel extends Component {
55 55
         /**
56 56
          * Styles for the presence label.
57 57
          */
58
-        styles: PropTypes.object,
58
+        style: PropTypes.object,
59 59
 
60 60
         /**
61 61
          * Invoked to obtain translated strings.
@@ -70,14 +70,20 @@ class PresenceLabel extends Component {
70 70
      * @returns {ReactElement}
71 71
      */
72 72
     render() {
73
-        const { _presence, styles, noContentStyles } = this.props;
74
-        const combinedStyles = _presence ? styles : noContentStyles;
73
+        const text = this._getPresenceText();
74
+
75
+        if (text === null) {
76
+            return null;
77
+        }
78
+
79
+        const { style, className } = this.props;
75 80
 
76 81
         return (
77
-            <Text { ...combinedStyles }>
78
-                { this._getPresenceText() }
79
-            </Text>
80
-        );
82
+            <Text
83
+                className = { className }
84
+                { ...style }>
85
+                { text }
86
+            </Text>);
81 87
     }
82 88
 
83 89
     /**

Carregando…
Cancelar
Salvar