From 8d3876c7d04dea503e4c08f97e475069527eba5b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 9 Feb 2017 15:14:16 +0000 Subject: [PATCH] MELS: either expanded or summary, not both Fixes vector-im/riot-web#3097 --- .../views/elements/MemberEventListSummary.js | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index 1a73b5a50e..1eb7b928d1 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -108,7 +108,7 @@ module.exports = React.createClass({ } return ( - + {summaries.join(", ")} ); @@ -264,7 +264,7 @@ module.exports = React.createClass({ ); }); return ( - + {avatars} ); @@ -397,31 +397,28 @@ module.exports = React.createClass({ (seq1, seq2) => aggregate.indices[seq1] > aggregate.indices[seq2] ); - const avatars = this._renderAvatars(avatarMembers); - const summary = this._renderSummary(aggregate.names, orderedTransitionSequences); - const toggleButton = ( - - {expanded ? 'collapse' : 'expand'} - - ); - - const summaryContainer = ( -
-
- - {avatars} - - - {summary} -   - {toggleButton} + let summaryContainer = null; + if (!expanded) { + summaryContainer = ( +
+
+ {this._renderAvatars(avatarMembers)} + {this._renderSummary(aggregate.names, orderedTransitionSequences)} +
+ ); + } + const toggleButton = ( +
+ {expanded ? 'collapse' : 'expand'}
); return (
+ {toggleButton} {summaryContainer} + {expanded ?
 
: null} {expandedEvents}
);