From 01458eeff9be89f30886ee31b8c3455f11afe568 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Thu, 2 May 2019 13:53:17 -0700 Subject: [PATCH] ref(chat): add a header for holding the close button --- css/_chat.scss | 44 +++++++++++++--------- react/features/chat/components/web/Chat.js | 24 ++++++++++-- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/css/_chat.scss b/css/_chat.scss index 4a025849e..8256ef75e 100644 --- a/css/_chat.scss +++ b/css/_chat.scss @@ -42,7 +42,6 @@ flex: 1; font-size: 10pt; line-height: 20px; - margin-top: $desktopAppDragBarHeight + 5px; overflow: auto; padding: 5px; text-align: left; @@ -92,21 +91,32 @@ } } -.chat-close { - background: gray; - border: 3px solid rgba(255, 255, 255, 0.1); - border-radius: 100%; - color: white; - cursor:pointer; - height: 10px; - line-height: 10px; - padding: 4px; - position: absolute; - right: 5px; - text-align: center; - top: $desktopAppDragBarHeight; - width: 10px; +.chat-header { + background-color: rgba(42, 58, 75, 0.9); + height: 70px; + position: relative; + width: 100%; z-index: 1; + + .chat-close { + align-items: center; + bottom: 8px; + color: white; + cursor: pointer; + display: flex; + font-size: 18px; + height: 40px; + justify-content: center; + line-height: 15px; + padding: 4px; + position: absolute; + right: 5px; + width: 40px; + + &:hover { + color: rgba(255, 255, 255, 0.8); + } + } } #chat-input { @@ -146,14 +156,12 @@ } #nickname { - position: absolute; text-align: center; color: #9d9d9d; font-size: 18px; - top: 100px; + margin-top: 30px; left: 5px; right: 5px; - width: 95%; } #chat_container .display-name { diff --git a/react/features/chat/components/web/Chat.js b/react/features/chat/components/web/Chat.js index 6f83386bf..1bbf29b98 100644 --- a/react/features/chat/components/web/Chat.js +++ b/react/features/chat/components/web/Chat.js @@ -106,6 +106,7 @@ class Chat extends AbstractChat {
+ { this._renderChatHeader() }
{ messages }
@@ -114,6 +115,23 @@ class Chat extends AbstractChat { ); } + /** + * Instantiates a React Element to display at the top of {@code Chat} to + * close {@code Chat}. + * + * @private + * @returns {ReactElement} + */ + _renderChatHeader() { + return ( +
+
X
+
+ ); + } + _renderMessage: (Object) => void; /** @@ -145,14 +163,12 @@ class Chat extends AbstractChat { _renderPanelContent(state) { this._isExited = state === 'exited'; - const { _isOpen, _onToggleChat, _showNamePrompt } = this.props; + const { _isOpen, _showNamePrompt } = this.props; const ComponentToRender = !_isOpen && state === 'exited' ? null : (
-
X
+ { this._renderChatHeader() } { _showNamePrompt ? : this._renderChat() }