Merge pull request #216 from Razzeee/align-unread-tabbar

Bold unread tabitem if there are unread messages
This commit is contained in:
Yuya Ochiai
2016-07-28 23:02:00 +09:00
committed by GitHub
2 changed files with 27 additions and 33 deletions

View File

@@ -7,6 +7,7 @@ The "UNDER DEVELOPMENT" section of the Mattermost Desktop changelog appears in t
Release date: TBD
### Improvements
- Changed display of unread messages on the team tabbar, they are now shown as bold text
#### Windows
- Update Mattermost icon for desktop notifications in Windows 10.

View File

@@ -219,30 +219,16 @@ var TabBar = React.createClass({
var tabs = this.props.teams.map(function(team, index) {
var unreadCount = 0;
var badgeStyle = {
unread: {
background: '#383838',
float: 'right',
color: 'white',
textAlign: 'center',
marginTop: '5px',
width: '10px',
height: '10px',
marginLeft: '5px',
borderRadius: '50%',
},
mention: {
background: '#f1342c',
float: 'right',
color: 'white',
minWidth: '19px',
fontSize: '12px',
textAlign: 'center',
lineHeight: '20px',
height: '19px',
marginLeft: '5px',
borderRadius: '50%',
}
background: '#FF1744',
float: 'right',
color: 'white',
minWidth: '19px',
fontSize: '12px',
textAlign: 'center',
lineHeight: '20px',
height: '19px',
marginLeft: '5px',
borderRadius: '50%',
};
if (thisObj.props.unreadCounts[index] > 0) {
@@ -262,18 +248,25 @@ var TabBar = React.createClass({
var badge;
if (mentionCount != 0) {
badge = (<div style={ badgeStyle.mention }>
badge = (<div style={ badgeStyle }>
{ mentionCount }
</div>);
} else if (unreadCount > 0) {
badge = (<div style={ badgeStyle.unread }></div>);
}
var id = 'teamTabItem' + index;
return (<NavItem className="teamTabItem" key={ id } id={ id } eventKey={ index }>
{ team.name }
{ ' ' }
{ badge }
</NavItem>);
if (unreadCount == 0) {
var id = 'teamTabItem' + index;
return (<NavItem className="teamTabItem" key={ id } id={ id } eventKey={ index }>
{ team.name }
{ ' ' }
{ badge }
</NavItem>);
} else {
var id = 'teamTabItem' + index;
return (<NavItem className="teamTabItem" key={ id } id={ id } eventKey={ index }>
<b>{ team.name }</b>
{ ' ' }
{ badge }
</NavItem>);
}
});
return (
<Nav id={ this.props.id } bsStyle="tabs" activeKey={ this.props.activeKey } onSelect={ this.props.onSelect }>