Clamp reaction content width to at most 100px

Part of https://github.com/vector-im/riot-web/issues/10256
pull/21833/head
J. Ryan Stinnett 2019-07-05 16:17:17 +01:00
parent 2a8f9a81f7
commit eb0e1eade4
2 changed files with 15 additions and 2 deletions

View File

@ -15,7 +15,7 @@ limitations under the License.
*/ */
.mx_ReactionsRowButton { .mx_ReactionsRowButton {
display: inline-block; display: inline-flex;
height: 20px; height: 20px;
line-height: 21px; line-height: 21px;
margin-right: 6px; margin-right: 6px;
@ -35,3 +35,11 @@ limitations under the License.
border-color: $reaction-row-button-selected-border-color; border-color: $reaction-row-button-selected-border-color;
} }
} }
.mx_ReactionsRowButton_content {
max-width: 100px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 4px;
}

View File

@ -101,7 +101,12 @@ export default class ReactionsRowButton extends React.PureComponent {
onMouseOver={this.onMouseOver} onMouseOver={this.onMouseOver}
onMouseOut={this.onMouseOut} onMouseOut={this.onMouseOut}
> >
{content} {count} <span className="mx_ReactionsRowButton_content">
{content}
</span>
<span className="mx_ReactionsRowButton_count">
{count}
</span>
{tooltip} {tooltip}
</span>; </span>;
} }