Преглед на файлове

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

master
Leonard Kim преди 6 години
родител
ревизия
01458eeff9
променени са 2 файла, в които са добавени 46 реда и са изтрити 22 реда
  1. 26
    18
      css/_chat.scss
  2. 20
    4
      react/features/chat/components/web/Chat.js

+ 26
- 18
css/_chat.scss Целия файл

@@ -42,7 +42,6 @@
42 42
     flex: 1;
43 43
     font-size: 10pt;
44 44
     line-height: 20px;
45
-    margin-top: $desktopAppDragBarHeight + 5px;
46 45
     overflow: auto;
47 46
     padding: 5px;
48 47
     text-align: left;
@@ -92,21 +91,32 @@
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 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 122
 #chat-input {
@@ -146,14 +156,12 @@
146 156
 }
147 157
 
148 158
 #nickname {
149
-    position: absolute;
150 159
     text-align: center;
151 160
     color: #9d9d9d;
152 161
     font-size: 18px;
153
-    top: 100px;
162
+    margin-top: 30px;
154 163
     left: 5px;
155 164
     right: 5px;
156
-    width: 95%;
157 165
 }
158 166
 
159 167
 #chat_container .display-name {

+ 20
- 4
react/features/chat/components/web/Chat.js Целия файл

@@ -106,6 +106,7 @@ class Chat extends AbstractChat<Props> {
106 106
             <div
107 107
                 className = 'sideToolbarContainer__inner'
108 108
                 id = 'chat_container'>
109
+                { this._renderChatHeader() }
109 110
                 <div id = 'chatconversation'>
110 111
                     { messages }
111 112
                 </div>
@@ -114,6 +115,23 @@ class Chat extends AbstractChat<Props> {
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 135
     _renderMessage: (Object) => void;
118 136
 
119 137
     /**
@@ -145,14 +163,12 @@ class Chat extends AbstractChat<Props> {
145 163
     _renderPanelContent(state) {
146 164
         this._isExited = state === 'exited';
147 165
 
148
-        const { _isOpen, _onToggleChat, _showNamePrompt } = this.props;
166
+        const { _isOpen, _showNamePrompt } = this.props;
149 167
         const ComponentToRender = !_isOpen && state === 'exited'
150 168
             ? null
151 169
             : (
152 170
                 <div>
153
-                    <div
154
-                        className = 'chat-close'
155
-                        onClick = { _onToggleChat }>X</div>
171
+                    { this._renderChatHeader() }
156 172
                     { _showNamePrompt
157 173
                         ? <DisplayNameForm /> : this._renderChat() }
158 174
                 </div>

Loading…
Отказ
Запис