Limit reaction sender tooltip to 6 people

This limits the number of senders shown in the reaction sender tooltip shown
when hovering a reaction to 6 people followed by "and N others" for the rest.

Fixes https://github.com/vector-im/riot-web/issues/9722
pull/21833/head
J. Ryan Stinnett 2019-05-20 16:02:10 +01:00
parent 0e5f0f24cc
commit 1bc9badeac
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
import sdk from '../../../index';
import { unicodeToShort } from '../../../HtmlUtils';
import { _t } from '../../../languageHandler';
import { formatCommaSeparatedList } from '../../../utils/FormattingUtils';
export default class ReactionsRowButtonTooltip extends React.PureComponent {
static propTypes = {
@ -54,7 +55,7 @@ export default class ReactionsRowButtonTooltip extends React.PureComponent {
{
reactors: () => {
return <div className="mx_ReactionsRowButtonTooltip_senders">
{senders.join(", ")}
{formatCommaSeparatedList(senders, 6)}
</div>;
},
reactedWith: (sub) => {