Uppercase the first letter of the app tile name.

This commit is contained in:
Richard Lewis 2017-06-28 10:27:06 +01:00
parent 3872f0750c
commit ad2517bd8b

View file

@ -61,11 +61,20 @@ export default React.createClass({
} }
}, },
formatAppTileName: function() {
let appTileName = "No name";
if(this.props.name && this.props.name.trim()) {
appTileName = this.props.name.trim();
appTileName = appTileName[0].toUpperCase() + appTileName.slice(1).toLowerCase();
}
return appTileName;
},
render: function() { render: function() {
return ( return (
<div className={this.props.fullWidth ? "mx_AppTileFullWidth" : "mx_AppTile"} id={this.props.id}> <div className={this.props.fullWidth ? "mx_AppTileFullWidth" : "mx_AppTile"} id={this.props.id}>
<div className="mx_AppTileMenuBar"> <div className="mx_AppTileMenuBar">
{this.props.name} {this.formatAppTileName()}
<span className="mx_AppTileMenuBarWidgets"> <span className="mx_AppTileMenuBarWidgets">
{/* Edit widget */} {/* Edit widget */}
{/* <img {/* <img