fix for broken UI when too many users are online in a topic
This commit is contained in:
@@ -1052,6 +1052,17 @@ i.search {
|
|||||||
margin-right: 0.2rem;
|
margin-right: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#topic-users .avatar-box > .material-icons {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
line-height: 1.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Overflow span "+18 more" */
|
||||||
|
#topic-users > span {
|
||||||
|
line-height: 2rem;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
/* Scrollable panel where the messages are shown */
|
/* Scrollable panel where the messages are shown */
|
||||||
#messages-panel {
|
#messages-panel {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tinode-webapp",
|
"name": "tinode-webapp",
|
||||||
"description": "Tinode messenger for the web",
|
"description": "Tinode messenger for the web",
|
||||||
"version": "0.15.15-rc1",
|
"version": "0.15.15-rc2",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.3.4",
|
||||||
"@babel/preset-env": "^7.3.4",
|
"@babel/preset-env": "^7.3.4",
|
||||||
|
|||||||
@@ -59,3 +59,7 @@ export const MAX_EXTERN_ATTACHMENT_SIZE = 1 << 23;
|
|||||||
// Maximum allowed linear dimension of an inline image in pixels. You may want
|
// Maximum allowed linear dimension of an inline image in pixels. You may want
|
||||||
// to adjust it to 1600 or 2400 for production.
|
// to adjust it to 1600 or 2400 for production.
|
||||||
export const MAX_IMAGE_DIM = 768;
|
export const MAX_IMAGE_DIM = 768;
|
||||||
|
|
||||||
|
// Maximum number of online users to be shown in a topic title bar. Others will be
|
||||||
|
// hidden under "+X more"
|
||||||
|
export const MAX_ONLINE_IN_TOPIC = 4;
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
"title_all_contacts": "All Contacts",
|
"title_all_contacts": "All Contacts",
|
||||||
"button_ok": "OK",
|
"button_ok": "OK",
|
||||||
"button_cancel": "Cancel",
|
"button_cancel": "Cancel",
|
||||||
|
"more_online_members": "+{overflow} more",
|
||||||
"download_action": "download",
|
"download_action": "download",
|
||||||
"label_file_name": "File name:",
|
"label_file_name": "File name:",
|
||||||
"label_content_type": "Content type:",
|
"label_content_type": "Content type:",
|
||||||
|
|||||||
+2
-1
@@ -131,5 +131,6 @@
|
|||||||
"chat_invitation_ignore": "Игнорировать",
|
"chat_invitation_ignore": "Игнорировать",
|
||||||
"chat_invitation_block": "Заблокировать",
|
"chat_invitation_block": "Заблокировать",
|
||||||
"peers_messaging_disabled": "Чат заблокирован у корреспондента.",
|
"peers_messaging_disabled": "Чат заблокирован у корреспондента.",
|
||||||
"enable_peers_messaging": "Разблокировать."
|
"enable_peers_messaging": "Разблокировать.",
|
||||||
|
"more_online_members": "+еще {overflow}"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -101,6 +101,7 @@
|
|||||||
"title_all_contacts": "All Contacts",
|
"title_all_contacts": "All Contacts",
|
||||||
"button_ok": "OK",
|
"button_ok": "OK",
|
||||||
"button_cancel": "Cancel",
|
"button_cancel": "Cancel",
|
||||||
|
"more_online_members": "+{overflow} more",
|
||||||
"download_action": "download",
|
"download_action": "download",
|
||||||
"label_file_name": "File name:",
|
"label_file_name": "File name:",
|
||||||
"label_content_type": "Content type:",
|
"label_content_type": "Content type:",
|
||||||
@@ -267,6 +268,7 @@
|
|||||||
"chat_invitation_ignore": "Игнорировать",
|
"chat_invitation_ignore": "Игнорировать",
|
||||||
"chat_invitation_block": "Заблокировать",
|
"chat_invitation_block": "Заблокировать",
|
||||||
"peers_messaging_disabled": "Чат заблокирован у корреспондента.",
|
"peers_messaging_disabled": "Чат заблокирован у корреспондента.",
|
||||||
"enable_peers_messaging": "Разблокировать."
|
"enable_peers_messaging": "Разблокировать.",
|
||||||
|
"more_online_members": "+еще {overflow}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
// This is a generated file. Don't edit.
|
// This is a generated file. Don't edit.
|
||||||
|
|
||||||
export const PACKAGE_VERSION = "0.15.15-rc1";
|
export const PACKAGE_VERSION = "0.15.15-rc2";
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
/* GroupSubs: a list of group subscribers currently online */
|
// GroupSubs: a list of group subscribers currently online.
|
||||||
|
// Show in the topic title bar
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
import { MAX_ONLINE_IN_TOPIC } from '../config.js'
|
||||||
|
|
||||||
import LetterTile from './letter-tile.jsx';
|
import LetterTile from './letter-tile.jsx';
|
||||||
import { makeImageUrl } from '../lib/blob-helpers.js';
|
import { makeImageUrl } from '../lib/blob-helpers.js';
|
||||||
@@ -12,7 +15,10 @@ export default class GroupSubs extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const usersOnline = [];
|
const usersOnline = [];
|
||||||
(this.props.subscribers || []).map((sub) => {
|
const totalCount = (this.props.subscribers || []).length;
|
||||||
|
const countToShow = Math.min(MAX_ONLINE_IN_TOPIC, totalCount);
|
||||||
|
|
||||||
|
(this.props.subscribers || []).some((sub) => {
|
||||||
usersOnline.push(
|
usersOnline.push(
|
||||||
<div className="avatar-box" key={sub.user}>
|
<div className="avatar-box" key={sub.user}>
|
||||||
<LetterTile
|
<LetterTile
|
||||||
@@ -21,9 +27,17 @@ export default class GroupSubs extends React.Component {
|
|||||||
title={sub.public ? sub.public.fn : null} />
|
title={sub.public ? sub.public.fn : null} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
return usersOnline.length == countToShow;
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="topic-users">{usersOnline}</div>
|
<div id="topic-users">{usersOnline} {totalCount > countToShow ?
|
||||||
|
<span>
|
||||||
|
<FormattedMessage id="more_online_members" defaultMessage="+{overflow} more"
|
||||||
|
description="Shown in MessagesView title bar when the number of online subscribers exceeds MAX_ONLINE_IN_TOPIC"
|
||||||
|
values={{ overflow: (totalCount - countToShow) }} />
|
||||||
|
</span> : null}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+25
-9
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user