1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-10 09:22:25 +03:00

Tweak limits so show all reveals more space than itself

This commit is contained in:
J. Ryan Stinnett
2019-06-28 14:46:57 +01:00
parent 59b4a3398d
commit 04398b7853

View File

@@ -138,8 +138,11 @@ export default class ReactionsRow extends React.PureComponent {
/>; />;
}).filter(item => !!item); }).filter(item => !!item);
// Show the first MAX_ITEMS if there are MAX_ITEMS + 1 or more items.
// The "+ 1" ensure that the "show all" reveals something that takes up
// more space than the button itself.
let showAllLink; let showAllLink;
if (items.length > MAX_ITEMS_WHEN_LIMITED && !showAll) { if ((items.length > MAX_ITEMS_WHEN_LIMITED + 1) && !showAll) {
items = items.slice(0, MAX_ITEMS_WHEN_LIMITED); items = items.slice(0, MAX_ITEMS_WHEN_LIMITED);
showAllLink = <a showAllLink = <a
className="mx_ReactionsRow_showAll" className="mx_ReactionsRow_showAll"