Skip to content
Snippets Groups Projects
Commit 121e4798 authored by Bobak Oftadeh's avatar Bobak Oftadeh
Browse files

Changed chat-width from pixel to precent.

parent cacc5e19
No related branches found
No related tags found
No related merge requests found
......@@ -223,12 +223,9 @@ class App extends Component {
const { chat } = this.props;
// Variables for resizing chat.
const CHAT_MIN_WIDTH_PX = 180;
const CHAT_MAX_WIDTH_PX = 600;
const CHAT_DEFAULT_WIDTH_RELATIVE = 25;
// decide whether using pixel or percentage unit as a default width for chat
const CHAT_DEFAULT_WIDTH = (window.innerWidth * (CHAT_DEFAULT_WIDTH_RELATIVE / 100.0)) < CHAT_MAX_WIDTH_PX ? `${CHAT_DEFAULT_WIDTH_RELATIVE}%` : CHAT_MAX_WIDTH_PX;
const CHAT_MIN_WIDTH = '10%';
const CHAT_MAX_WIDTH = '25%';
const CHAT_DEFAULT_WIDTH = '15%';
if (!chat) return null;
......@@ -246,8 +243,8 @@ class App extends Component {
return (
<Resizable
defaultSize={{ width: CHAT_DEFAULT_WIDTH }}
minWidth={CHAT_MIN_WIDTH_PX}
maxWidth={CHAT_MAX_WIDTH_PX}
minWidth={CHAT_MIN_WIDTH}
maxWidth={CHAT_MAX_WIDTH}
ref={(node) => { this.resizableChat = node; }}
className={styles.resizableChat}
enable={resizableEnableOptions}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment