Browse Source

ref(contact-list): remove invite functionality (#2017)

* ref(contact-list): remove invite functionality

Removing becuase there is already a toolbar button dedicated
to opening the invite dialog. Now the contact list focuses
on showing current participants.

* squash: remove unused strings and styling

* squash: add plural to panel title
master
virtuacoplenny 7 years ago
parent
commit
802d347574

+ 0
- 12
css/_contact_list.scss View File

1
 #contacts_container {
1
 #contacts_container {
2
     cursor: default;
2
     cursor: default;
3
 
3
 
4
-    /**
5
-     * Override generic side toolbar styles to compensate for AtlasKit Button
6
-     * being used instead of custom button styling.
7
-     */
8
-    .sideToolbarBlock {
9
-        .contact-list-panel-invite-button {
10
-            font-size: $modalButtonFontSize;
11
-            justify-content: center;
12
-            margin: 9px 0;
13
-        }
14
-    }
15
-
16
     #contacts {
4
     #contacts {
17
         font-size: 12px;
5
         font-size: 12px;
18
         bottom: 0px;
6
         bottom: 0px;

+ 0
- 13
css/components/_form-control.scss View File

23
         color: $inputControlEmColor;
23
         color: $inputControlEmColor;
24
     }
24
     }
25
 
25
 
26
-    &__hint {
27
-        margin-top: 0;
28
-        font-size: $hintFontSize;
29
-
30
-        span {
31
-            vertical-align: middle;
32
-        }
33
-
34
-        &_error {
35
-            color: $errorColor;
36
-        }
37
-    }
38
-
39
     &__container {
26
     &__container {
40
         position: relative;
27
         position: relative;
41
         width: 100%;
28
         width: 100%;

+ 2
- 4
lang/main.json View File

1
 {
1
 {
2
-    "contactlist": "__pcount__ Members",
3
-    "addParticipants": "Share the link",
4
-    "roomLocked": "Callers must enter a password",
5
-    "roomUnlocked": "Anyone with the link can join",
2
+    "contactlist": "__count__ Member",
3
+    "contactlist_plural": "__count__ Members",
6
     "passwordSetRemotely": "set by another member",
4
     "passwordSetRemotely": "set by another member",
7
     "connectionsettings": "Connection Settings",
5
     "connectionsettings": "Connection Settings",
8
     "poweredby": "powered by",
6
     "poweredby": "powered by",

+ 8
- 89
react/features/contact-list/components/ContactListPanel.web.js View File

1
-import Button from '@atlaskit/button';
2
 import PropTypes from 'prop-types';
1
 import PropTypes from 'prop-types';
3
 import React, { Component } from 'react';
2
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
5
 
4
 
6
 import { translate } from '../../base/i18n';
5
 import { translate } from '../../base/i18n';
7
 import { getAvatarURL, getParticipants } from '../../base/participants';
6
 import { getAvatarURL, getParticipants } from '../../base/participants';
8
-import { openInviteDialog } from '../../invite';
9
 
7
 
10
 import ContactListItem from './ContactListItem';
8
 import ContactListItem from './ContactListItem';
11
 
9
 
12
 declare var interfaceConfig: Object;
10
 declare var interfaceConfig: Object;
13
 
11
 
14
 /**
12
 /**
15
- * React component for showing a list of current conference participants, the
16
- * current conference lock state, and a button to open the invite dialog.
13
+ * React component for showing a list of current conference participants.
17
  *
14
  *
18
  * @extends Component
15
  * @extends Component
19
  */
16
  */
24
      * @static
21
      * @static
25
      */
22
      */
26
     static propTypes = {
23
     static propTypes = {
27
-        /**
28
-         * Whether or not the conference is currently locked with a password.
29
-         */
30
-        _locked: PropTypes.bool,
31
-
32
         /**
24
         /**
33
          * The participants to show in the contact list.
25
          * The participants to show in the contact list.
34
          */
26
          */
35
         _participants: PropTypes.array,
27
         _participants: PropTypes.array,
36
 
28
 
37
         /**
29
         /**
38
-         * Invoked to open an invite dialog.
30
+         * Whether or not participant avatars should be displayed.
39
          */
31
          */
40
-        dispatch: PropTypes.func,
32
+        _showAvatars: PropTypes.bool,
41
 
33
 
42
         /**
34
         /**
43
          * Invoked to obtain translated strings.
35
          * Invoked to obtain translated strings.
45
         t: PropTypes.func
37
         t: PropTypes.func
46
     };
38
     };
47
 
39
 
48
-    /**
49
-     * Initializes a new {@code ContactListPanel} instance.
50
-     *
51
-     * @param {Object} props - The read-only properties with which the new
52
-     * instance is to be initialized.
53
-     */
54
-    constructor(props) {
55
-        super(props);
56
-
57
-        // Bind event handler so it is only bound once for every instance.
58
-        this._onOpenInviteDialog = this._onOpenInviteDialog.bind(this);
59
-    }
60
-
61
     /**
40
     /**
62
      * Implements React's {@link Component#render()}.
41
      * Implements React's {@link Component#render()}.
63
      *
42
      *
64
      * @inheritdoc
43
      * @inheritdoc
65
      */
44
      */
66
     render() {
45
     render() {
67
-        const { _locked, _participants, t } = this.props;
46
+        const { _participants, t } = this.props;
68
 
47
 
69
         return (
48
         return (
70
             <div className = 'contact-list-panel'>
49
             <div className = 'contact-list-panel'>
71
                 <div className = 'title'>
50
                 <div className = 'title'>
72
-                    { t('contactlist', { pcount: _participants.length }) }
73
-                </div>
74
-                <div className = 'sideToolbarBlock first'>
75
-                    <Button
76
-                        appearance = 'primary'
77
-                        className = 'contact-list-panel-invite-button'
78
-                        id = 'addParticipantsBtn'
79
-                        onClick = { this._onOpenInviteDialog }
80
-                        type = 'button'>
81
-                        { t('addParticipants') }
82
-                    </Button>
83
-                    <div>
84
-                        { _locked
85
-                            ? this._renderLockedMessage()
86
-                            : this._renderUnlockedMessage() }
87
-                    </div>
51
+                    { t('contactlist', { count: _participants.length }) }
88
                 </div>
52
                 </div>
89
                 <ul id = 'contacts'>
53
                 <ul id = 'contacts'>
90
                     { this._renderContacts() }
54
                     { this._renderContacts() }
93
         );
57
         );
94
     }
58
     }
95
 
59
 
96
-    /**
97
-     * Dispatches an action to open an invite dialog.
98
-     *
99
-     * @private
100
-     * @returns {void}
101
-     */
102
-    _onOpenInviteDialog() {
103
-        this.props.dispatch(openInviteDialog());
104
-    }
105
-
106
     /**
60
     /**
107
      * Renders React Elements for displaying information about each participant
61
      * Renders React Elements for displaying information about each participant
108
      * in the contact list.
62
      * in the contact list.
116
 
70
 
117
             return (
71
             return (
118
                 <ContactListItem
72
                 <ContactListItem
119
-                    avatarURI = { interfaceConfig.SHOW_CONTACTLIST_AVATARS
73
+                    avatarURI = { this.props._showAvatars
120
                         ? getAvatarURL(participant) : null }
74
                         ? getAvatarURL(participant) : null }
121
                     id = { id }
75
                     id = { id }
122
                     key = { id }
76
                     key = { id }
124
             );
78
             );
125
         });
79
         });
126
     }
80
     }
127
-
128
-    /**
129
-     * Renders a React Element for informing the conference is currently locked.
130
-     *
131
-     * @private
132
-     * @returns {ReactElement}
133
-     */
134
-    _renderLockedMessage() {
135
-        return (
136
-            <p
137
-                className = 'form-control__hint form-control_full-width'
138
-                id = 'contactListroomLocked'>
139
-                <span className = 'icon-security-locked' />
140
-                <span>{ this.props.t('roomLocked') }</span>
141
-            </p>
142
-        );
143
-    }
144
-
145
-    /**
146
-     * Renders a React Element for informing the conference is currently not
147
-     * locked.
148
-     *
149
-     * @private
150
-     * @returns {ReactElement}
151
-     */
152
-    _renderUnlockedMessage() {
153
-        return (
154
-            <p
155
-                className = 'form-control__hint form-control_full-width'
156
-                id = 'contactListroomUnlocked'>
157
-                <span className = 'icon-security' />
158
-                <span>{ this.props.t('roomUnlocked') }</span>
159
-            </p>
160
-        );
161
-    }
162
 }
81
 }
163
 
82
 
164
 /**
83
 /**
174
  */
93
  */
175
 function _mapStateToProps(state) {
94
 function _mapStateToProps(state) {
176
     return {
95
     return {
177
-        _locked: state['features/base/conference'].locked,
178
-        _participants: getParticipants(state)
96
+        _participants: getParticipants(state),
97
+        _showAvatars: interfaceConfig.SHOW_CONTACTLIST_AVATARS
179
     };
98
     };
180
 }
99
 }
181
 
100
 

Loading…
Cancel
Save