浏览代码

ref(chat): clean up extra dom

master
Leonard Kim 6 年前
父节点
当前提交
a49f62238b
共有 2 个文件被更改,包括 29 次插入36 次删除
  1. 24
    28
      css/_chat.scss
  2. 5
    8
      react/features/chat/components/web/Chat.js

+ 24
- 28
css/_chat.scss 查看文件

1
 #sideToolbarContainer {
1
 #sideToolbarContainer {
2
     background-color: $newToolbarBackgroundColor;
2
     background-color: $newToolbarBackgroundColor;
3
-
3
+    box-sizing: border-box;
4
+    color: #FFF;
5
+    display: flex;
6
+    flex-direction: column;
4
     /**
7
     /**
5
      * Make the sidebar flush with the top of the toolbar. Take the size of
8
      * Make the sidebar flush with the top of the toolbar. Take the size of
6
      * the toolbar and subtract from 100%.
9
      * the toolbar and subtract from 100%.
21
     &.slideInExt {
24
     &.slideInExt {
22
         left: 0;
25
         left: 0;
23
     }
26
     }
24
-
25
-    .sideToolbarContainer__inner {
26
-        box-sizing: border-box;
27
-        color: #FFF;
28
-        display: flex;
29
-        flex-direction: column;
30
-        height: 100%;
31
-        width: $sidebarWidth;
32
-    }
33
-}
34
-
35
-#chat_container * {
36
-    -webkit-user-select: text;
37
-    user-select: text;
38
 }
27
 }
39
 
28
 
40
 #chatconversation {
29
 #chatconversation {
166
     right: 5px;
155
     right: 5px;
167
 }
156
 }
168
 
157
 
169
-#chat_container .display-name {
170
-    float: left;
171
-    padding-left: 5px;
172
-    font-weight: bold;
173
-    white-space: nowrap;
174
-    text-overflow: ellipsis;
175
-    width: 95%;
176
-    overflow: hidden;
177
-}
158
+.sideToolbarContainer {
159
+    * {
160
+        -webkit-user-select: text;
161
+        user-select: text;
162
+    }
163
+
164
+    .display-name {
165
+        float: left;
166
+        padding-left: 5px;
167
+        font-weight: bold;
168
+        white-space: nowrap;
169
+        text-overflow: ellipsis;
170
+        width: 95%;
171
+        overflow: hidden;
172
+    }
178
 
173
 
179
-#chat_container .timestamp {
180
-    float: right;
181
-    padding-right: 5px;
182
-    font-size: 11px;
174
+    .timestamp {
175
+        float: right;
176
+        padding-right: 5px;
177
+        font-size: 11px;
178
+    }
183
 }
179
 }
184
 
180
 
185
 .usermessage {
181
 .usermessage {

+ 5
- 8
react/features/chat/components/web/Chat.js 查看文件

103
             ref = { this._setMessageListEndRef } />);
103
             ref = { this._setMessageListEndRef } />);
104
 
104
 
105
         return (
105
         return (
106
-            <div
107
-                className = 'sideToolbarContainer__inner'
108
-                id = 'chat_container'>
109
-                { this._renderChatHeader() }
106
+            <>
110
                 <div id = 'chatconversation'>
107
                 <div id = 'chatconversation'>
111
                     { messages }
108
                     { messages }
112
                 </div>
109
                 </div>
113
                 <ChatInput />
110
                 <ChatInput />
114
-            </div>
111
+            </>
115
         );
112
         );
116
     }
113
     }
117
 
114
 
167
         const ComponentToRender = !_isOpen && state === 'exited'
164
         const ComponentToRender = !_isOpen && state === 'exited'
168
             ? null
165
             ? null
169
             : (
166
             : (
170
-                <div>
167
+                <>
171
                     { this._renderChatHeader() }
168
                     { this._renderChatHeader() }
172
                     { _showNamePrompt
169
                     { _showNamePrompt
173
                         ? <DisplayNameForm /> : this._renderChat() }
170
                         ? <DisplayNameForm /> : this._renderChat() }
174
-                </div>
171
+                </>
175
             );
172
             );
176
         let className = '';
173
         let className = '';
177
 
174
 
183
 
180
 
184
         return (
181
         return (
185
             <div
182
             <div
186
-                className = { className }
183
+                className = { `sideToolbarContainer ${className}` }
187
                 id = 'sideToolbarContainer'>
184
                 id = 'sideToolbarContainer'>
188
                 { ComponentToRender }
185
                 { ComponentToRender }
189
             </div>
186
             </div>

正在加载...
取消
保存