Skip to content

Commit a2ca5f2

Browse files
committed
improve badges and room tile layout
1 parent 28dcfb2 commit a2ca5f2

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

skins/base/css/molecules/RoomTile.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,35 @@ limitations under the License.
2929
padding-top: 3px;
3030
padding-bottom: 3px;
3131
vertical-align: middle;
32-
width: 32px;
33-
height: 32px;
32+
width: 40px;
33+
height: 40px;
3434
}
3535

3636
.mx_RoomTile_avatar img {
3737
border-radius: 20px;
3838
background-color: #dbdbdb;
3939
}
4040

41+
.mx_RoomTile_nameBadge {
42+
display: table;
43+
width: 100%;
44+
height: 50px;
45+
}
46+
4147
.mx_RoomTile_name {
4248
display: table-cell;
4349
vertical-align: middle;
4450
overflow: hidden;
4551
text-overflow: ellipsis;
4652
}
4753

54+
.mx_RoomTile_badgeCell {
55+
display: table-cell;
56+
vertical-align: middle;
57+
width: 26px;
58+
}
59+
4860
.mx_RoomTile_badge {
49-
float: right;
5061
background-color: #80cef4;
5162
color: #fff;
5263
border-radius: 26px;

skins/base/views/molecules/RoomTile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,17 @@ module.exports = React.createClass({
4343
else if (this.props.unread) {
4444
badge = <div className="mx_RoomTile_badge">1</div>;
4545
}
46+
var nameCell;
47+
if (badge) {
48+
nameCell = <div className="mx_RoomTile_nameBadge"><div className="mx_RoomTile_name">{name}</div><div className="mx_RoomTile_badgeCell">{badge}</div></div>;
49+
}
50+
else {
51+
nameCell = <div className="mx_RoomTile_name">{name}</div>;
52+
}
4653
return (
4754
<div className={classes} onClick={this.onClick}>
4855
<div className="mx_RoomTile_avatar"><img src={ MatrixClientPeg.get().getAvatarUrlForRoom(this.props.room, 40, 40, "crop") } width="40" height="40"/></div>
49-
<div className="mx_RoomTile_name">{name}{ badge }</div>
56+
{ nameCell }
5057
</div>
5158
);
5259
}

0 commit comments

Comments
 (0)