ref(chat): clean up extra dom

This commit is contained in:
Leonard Kim 2019-05-03 14:26:28 -07:00 committed by virtuacoplenny
parent a8233bdb84
commit a49f62238b
2 changed files with 29 additions and 36 deletions

View File

@ -1,6 +1,9 @@
#sideToolbarContainer { #sideToolbarContainer {
background-color: $newToolbarBackgroundColor; background-color: $newToolbarBackgroundColor;
box-sizing: border-box;
color: #FFF;
display: flex;
flex-direction: column;
/** /**
* Make the sidebar flush with the top of the toolbar. Take the size of * Make the sidebar flush with the top of the toolbar. Take the size of
* the toolbar and subtract from 100%. * the toolbar and subtract from 100%.
@ -21,20 +24,6 @@
&.slideInExt { &.slideInExt {
left: 0; left: 0;
} }
.sideToolbarContainer__inner {
box-sizing: border-box;
color: #FFF;
display: flex;
flex-direction: column;
height: 100%;
width: $sidebarWidth;
}
}
#chat_container * {
-webkit-user-select: text;
user-select: text;
} }
#chatconversation { #chatconversation {
@ -166,20 +155,27 @@
right: 5px; right: 5px;
} }
#chat_container .display-name { .sideToolbarContainer {
float: left; * {
padding-left: 5px; -webkit-user-select: text;
font-weight: bold; user-select: text;
white-space: nowrap; }
text-overflow: ellipsis;
width: 95%;
overflow: hidden;
}
#chat_container .timestamp { .display-name {
float: right; float: left;
padding-right: 5px; padding-left: 5px;
font-size: 11px; font-weight: bold;
white-space: nowrap;
text-overflow: ellipsis;
width: 95%;
overflow: hidden;
}
.timestamp {
float: right;
padding-right: 5px;
font-size: 11px;
}
} }
.usermessage { .usermessage {

View File

@ -103,15 +103,12 @@ class Chat extends AbstractChat<Props> {
ref = { this._setMessageListEndRef } />); ref = { this._setMessageListEndRef } />);
return ( return (
<div <>
className = 'sideToolbarContainer__inner'
id = 'chat_container'>
{ this._renderChatHeader() }
<div id = 'chatconversation'> <div id = 'chatconversation'>
{ messages } { messages }
</div> </div>
<ChatInput /> <ChatInput />
</div> </>
); );
} }
@ -167,11 +164,11 @@ class Chat extends AbstractChat<Props> {
const ComponentToRender = !_isOpen && state === 'exited' const ComponentToRender = !_isOpen && state === 'exited'
? null ? null
: ( : (
<div> <>
{ this._renderChatHeader() } { this._renderChatHeader() }
{ _showNamePrompt { _showNamePrompt
? <DisplayNameForm /> : this._renderChat() } ? <DisplayNameForm /> : this._renderChat() }
</div> </>
); );
let className = ''; let className = '';
@ -183,7 +180,7 @@ class Chat extends AbstractChat<Props> {
return ( return (
<div <div
className = { className } className = { `sideToolbarContainer ${className}` }
id = 'sideToolbarContainer'> id = 'sideToolbarContainer'>
{ ComponentToRender } { ComponentToRender }
</div> </div>