Przeglądaj źródła

ref(chat): add a header for holding the close button

master
Leonard Kim 6 lat temu
rodzic
commit
01458eeff9
2 zmienionych plików z 46 dodań i 22 usunięć
  1. 26
    18
      css/_chat.scss
  2. 20
    4
      react/features/chat/components/web/Chat.js

+ 26
- 18
css/_chat.scss Wyświetl plik

42
     flex: 1;
42
     flex: 1;
43
     font-size: 10pt;
43
     font-size: 10pt;
44
     line-height: 20px;
44
     line-height: 20px;
45
-    margin-top: $desktopAppDragBarHeight + 5px;
46
     overflow: auto;
45
     overflow: auto;
47
     padding: 5px;
46
     padding: 5px;
48
     text-align: left;
47
     text-align: left;
92
     }
91
     }
93
 }
92
 }
94
 
93
 
95
-.chat-close {
96
-    background: gray;
97
-    border: 3px solid rgba(255, 255, 255, 0.1);
98
-    border-radius: 100%;
99
-    color: white;
100
-    cursor:pointer;
101
-    height: 10px;
102
-    line-height: 10px;
103
-    padding: 4px;
104
-    position: absolute;
105
-    right: 5px;
106
-    text-align: center;
107
-    top: $desktopAppDragBarHeight;
108
-    width: 10px;
94
+.chat-header {
95
+    background-color: rgba(42, 58, 75, 0.9);
96
+    height: 70px;
97
+    position: relative;
98
+    width: 100%;
109
     z-index: 1;
99
     z-index: 1;
100
+
101
+    .chat-close {
102
+        align-items: center;
103
+        bottom: 8px;
104
+        color: white;
105
+        cursor: pointer;
106
+        display: flex;
107
+        font-size: 18px;
108
+        height: 40px;
109
+        justify-content: center;
110
+        line-height: 15px;
111
+        padding: 4px;
112
+        position: absolute;
113
+        right: 5px;
114
+        width: 40px;
115
+
116
+        &:hover {
117
+            color: rgba(255, 255, 255, 0.8);
118
+        }
119
+    }
110
 }
120
 }
111
 
121
 
112
 #chat-input {
122
 #chat-input {
146
 }
156
 }
147
 
157
 
148
 #nickname {
158
 #nickname {
149
-    position: absolute;
150
     text-align: center;
159
     text-align: center;
151
     color: #9d9d9d;
160
     color: #9d9d9d;
152
     font-size: 18px;
161
     font-size: 18px;
153
-    top: 100px;
162
+    margin-top: 30px;
154
     left: 5px;
163
     left: 5px;
155
     right: 5px;
164
     right: 5px;
156
-    width: 95%;
157
 }
165
 }
158
 
166
 
159
 #chat_container .display-name {
167
 #chat_container .display-name {

+ 20
- 4
react/features/chat/components/web/Chat.js Wyświetl plik

106
             <div
106
             <div
107
                 className = 'sideToolbarContainer__inner'
107
                 className = 'sideToolbarContainer__inner'
108
                 id = 'chat_container'>
108
                 id = 'chat_container'>
109
+                { this._renderChatHeader() }
109
                 <div id = 'chatconversation'>
110
                 <div id = 'chatconversation'>
110
                     { messages }
111
                     { messages }
111
                 </div>
112
                 </div>
114
         );
115
         );
115
     }
116
     }
116
 
117
 
118
+    /**
119
+     * Instantiates a React Element to display at the top of {@code Chat} to
120
+     * close {@code Chat}.
121
+     *
122
+     * @private
123
+     * @returns {ReactElement}
124
+     */
125
+    _renderChatHeader() {
126
+        return (
127
+            <div className = 'chat-header'>
128
+                <div
129
+                    className = 'chat-close'
130
+                    onClick = { this.props._onToggleChat }>X</div>
131
+            </div>
132
+        );
133
+    }
134
+
117
     _renderMessage: (Object) => void;
135
     _renderMessage: (Object) => void;
118
 
136
 
119
     /**
137
     /**
145
     _renderPanelContent(state) {
163
     _renderPanelContent(state) {
146
         this._isExited = state === 'exited';
164
         this._isExited = state === 'exited';
147
 
165
 
148
-        const { _isOpen, _onToggleChat, _showNamePrompt } = this.props;
166
+        const { _isOpen, _showNamePrompt } = this.props;
149
         const ComponentToRender = !_isOpen && state === 'exited'
167
         const ComponentToRender = !_isOpen && state === 'exited'
150
             ? null
168
             ? null
151
             : (
169
             : (
152
                 <div>
170
                 <div>
153
-                    <div
154
-                        className = 'chat-close'
155
-                        onClick = { _onToggleChat }>X</div>
171
+                    { this._renderChatHeader() }
156
                     { _showNamePrompt
172
                     { _showNamePrompt
157
                         ? <DisplayNameForm /> : this._renderChat() }
173
                         ? <DisplayNameForm /> : this._renderChat() }
158
                 </div>
174
                 </div>

Ładowanie…
Anuluj
Zapisz