Merge pull request #1087 from asaadmahmoodspin/ui-improvements

Improving direct messages modal and some improvements for popovers
Этот коммит содержится в:
Harrison Healey
2015-10-19 09:40:43 -04:00
родитель e308923aec 13a35539f3
Коммит 814aa57fc1
6 изменённых файлов: 101 добавлений и 83 удалений

Просмотреть файл

@@ -83,7 +83,7 @@ export default class MoreChannels extends React.Component {
moreChannels = <LoadingScreen />; moreChannels = <LoadingScreen />;
} else if (channels.length) { } else if (channels.length) {
moreChannels = ( moreChannels = (
<table className='more-channel-table table'> <table className='more-table table'>
<tbody> <tbody>
{channels.map(function cMap(channel, index) { {channels.map(function cMap(channel, index) {
var joinButton; var joinButton;
@@ -108,8 +108,8 @@ export default class MoreChannels extends React.Component {
return ( return (
<tr key={channel.id}> <tr key={channel.id}>
<td> <td>
<p className='more-channel-name'>{channel.display_name}</p> <p className='more-name'>{channel.display_name}</p>
<p className='more-channel-description'>{channel.description}</p> <p className='more-description'>{channel.description}</p>
</td> </td>
<td className='td--action'> <td className='td--action'>
{joinButton} {joinButton}

Просмотреть файл

@@ -140,12 +140,12 @@ export default class MoreDirectChannels extends React.Component {
if (user.nickname) { if (user.nickname) {
const separator = fullName ? ' - ' : ''; const separator = fullName ? ' - ' : '';
details.push( details.push(
<span <p
key={`${user.nickname}__nickname`} key={`${user.nickname}__nickname`}
className='nickname' className='more-description'
> >
{separator + user.nickname} {separator + user.nickname}
</span> </p>
); );
} }
@@ -170,31 +170,38 @@ export default class MoreDirectChannels extends React.Component {
} }
return ( return (
<li <tr>
key={user.id} <td
className='direct-channel' key={user.id}
> className='direct-channel'
<div className='col-xs-1 image-div'> >
<img <img
className='profile-image' className='profile-img pull-left'
width='38'
height='38'
src={`/api/v1/users/${user.id}/image?time=${user.update_at}`} src={`/api/v1/users/${user.id}/image?time=${user.update_at}`}
/> />
</div> <div className='more-name'>
<div className='col-xs-9'>
<div className='username'>
{user.username} {user.username}
</div> </div>
<div> {details}
{details} </td>
</div> <td className='td--action lg'>
</div>
<div className='col-xs-2 btn-div'>
{joinButton} {joinButton}
</div> </td>
</li> </tr>
); );
} }
componentDidUpdate(prevProps) {
if (!prevProps.show && this.props.show) {
$(ReactDOM.findDOMNode(this.refs.userList)).css('max-height', $(window).height() - 300);
if ($(window).width() > 768) {
$(ReactDOM.findDOMNode(this.refs.userList)).perfectScrollbar();
}
}
}
render() { render() {
if (!this.props.show) { if (!this.props.show) {
return null; return null;
@@ -213,7 +220,7 @@ export default class MoreDirectChannels extends React.Component {
const userEntries = users.map(this.createRowForUser); const userEntries = users.map(this.createRowForUser);
if (userEntries.length === 0) { if (userEntries.length === 0) {
userEntries.push(<li key='no-users-found'>{'No users found :('}</li>); userEntries.push(<tr key='no-users-found'><td>{'No users found :('}</td></tr>);
} }
let memberString = 'Member'; let memberString = 'Member';
@@ -232,26 +239,35 @@ export default class MoreDirectChannels extends React.Component {
<Modal <Modal
className='modal-direct-channels' className='modal-direct-channels'
show={this.props.show} show={this.props.show}
bsSize='large'
onHide={this.handleHide} onHide={this.handleHide}
> >
<Modal.Header closeButton={true}> <Modal.Header closeButton={true}>
<Modal.Title>{'More Direct Messages'}</Modal.Title> <Modal.Title>{'Team Directory'}</Modal.Title>
</Modal.Header> </Modal.Header>
<Modal.Body> <Modal.Body>
<div> <div className='row filter-row'>
<input <div className='col-sm-6'>
ref='filter' <input
className='form-control filter-textbox' ref='filter'
placeholder='Search members' className='form-control filter-textbox'
onInput={this.handleFilterChange} placeholder='Search members'
style={{width: '200px', display: 'inline'}} onInput={this.handleFilterChange}
/> />
<span className='member-count pull-right'>{count}</span> </div>
<div className='col-sm-6'>
<span className='member-count'>{count}</span>
</div>
</div>
<div
ref='userList'
className='user-list'
>
<table className='more-table table'>
<tbody>
{userEntries}
</tbody>
</table>
</div> </div>
<ul className='user-list'>
{userEntries}
</ul>
</Modal.Body> </Modal.Body>
<Modal.Footer> <Modal.Footer>
<button <button

Просмотреть файл

@@ -132,7 +132,9 @@ export default class Sidebar extends React.Component {
SocketStore.addChangeListener(this.onSocketChange); SocketStore.addChangeListener(this.onSocketChange);
PreferenceStore.addChangeListener(this.onChange); PreferenceStore.addChangeListener(this.onChange);
$('.nav-pills__container').perfectScrollbar(); if ($(window).width() > 768) {
$('.nav-pills__container').perfectScrollbar();
}
this.updateTitle(); this.updateTitle();
this.updateUnreadIndicators(); this.updateUnreadIndicators();

Просмотреть файл

@@ -140,7 +140,7 @@
padding: 0; padding: 0;
} }
} }
.more-channel-table { .more-table {
margin: 0; margin: 0;
table-layout: fixed; table-layout: fixed;
p { p {
@@ -150,9 +150,11 @@
@include opacity(0.8); @include opacity(0.8);
margin: 5px 0; margin: 5px 0;
} }
.more-channel-name { .more-name {
font-weight: 600; font-weight: 600;
font-size: 0.95em; font-size: 0.95em;
overflow: hidden;
text-overflow: ellipsis;
} }
tbody { tbody {
> tr { > tr {
@@ -175,6 +177,9 @@
padding: 8px 15px 8px 8px; padding: 8px 15px 8px 8px;
width: 80px; width: 80px;
vertical-align: middle; vertical-align: middle;
&.lg {
width: 110px;
}
} }
} }
} }
@@ -331,47 +336,42 @@
} }
.modal-direct-channels { .modal-direct-channels {
.user-list {
list-style-type: none;
margin: 15px 0px 0px;
max-height: 600px;
padding: 0px;
overflow: auto;
li { .user-list {
border-bottom: 1px solid #ddd; margin-top: 20px;
height: 60px; overflow: auto;
padding: 10px 0px; -webkit-overflow-scrolling: touch;
max-height: 500px;
position: relative;
}
.image-div { .table {
padding: 0px; margin-top: 10px;
}
.profile-image { .modal-body {
width: 40px; padding: 20px 0 0;
height: 40px; @include clearfix;
@include border-radius(20px); }
}
}
.username { .filter-row {
font-weight: bold; padding: 0 15px;
} }
.nickname { .member-count {
color: #888; margin-top: 5px;
} float: right;
@include opacity(0.8);
}
.btn-div { .more-description {
padding: 0px; @include opacity(0.7);
.btn-message { }
position: relative;
top: 5px;
}
}
&:last-child { .profile-img {
border-bottom: 0px; -moz-border-radius: 50px;
} -webkit-border-radius: 50px;
} border-radius: 50px;
} margin-right: 8px;
}
} }

Просмотреть файл

@@ -270,6 +270,13 @@
height: auto; height: auto;
} }
} }
.modal-direct-channels {
.member-count {
float: none;
margin-top: 10px;
display: block;
}
}
.center-file-overlay { .center-file-overlay {
font-size: 1.3em; font-size: 1.3em;
} }

Просмотреть файл

@@ -230,13 +230,6 @@
font-weight:500; font-weight:500;
} }
.profile-img {
width:128px;
height:128px;
margin-bottom: 10px;
@include border-radius(128px);
}
.sel-btn { .sel-btn {
margin-right:5px; margin-right:5px;
} }