Added styling to search autocomplete
Этот коммит содержится в:
@@ -90,11 +90,14 @@ export default class SearchAutocomplete extends React.Component {
|
|||||||
channels = channels.filter((channel) => channel.name.startsWith(this.state.filter));
|
channels = channels.filter((channel) => channel.name.startsWith(this.state.filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channels.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|
||||||
suggestions = channels.map((channel) => {
|
suggestions = channels.map((channel) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={channel.id}
|
key={channel.id}
|
||||||
onClick={this.handleClick.bind(this, channel.name)}
|
onClick={this.handleClick.bind(this, channel.name)}
|
||||||
|
className='search-autocomplete__channel'
|
||||||
>
|
>
|
||||||
{channel.name}
|
{channel.name}
|
||||||
</div>
|
</div>
|
||||||
@@ -107,12 +110,19 @@ export default class SearchAutocomplete extends React.Component {
|
|||||||
users = users.filter((user) => user.username.startsWith(this.state.filter));
|
users = users.filter((user) => user.username.startsWith(this.state.filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
users.sort((a, b) => a.username.localeCompare(b.username));
|
||||||
|
|
||||||
suggestions = users.map((user) => {
|
suggestions = users.map((user) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={user.id}
|
key={user.id}
|
||||||
onClick={this.handleClick.bind(this, user.username)}
|
onClick={this.handleClick.bind(this, user.username)}
|
||||||
|
className='search-autocomplete__user'
|
||||||
>
|
>
|
||||||
|
<img
|
||||||
|
className='profile-img'
|
||||||
|
src={'/api/v1/users/' + user.id + '/image?time=' + user.update_at}
|
||||||
|
/>
|
||||||
{user.username}
|
{user.username}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -126,7 +136,7 @@ export default class SearchAutocomplete extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref='container'
|
ref='container'
|
||||||
style={{overflow: 'visible', position: 'absolute', zIndex: '100', background: 'yellow'}}
|
className='search-autocomplete'
|
||||||
>
|
>
|
||||||
{suggestions}
|
{suggestions}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -109,3 +109,33 @@
|
|||||||
.search-highlight {
|
.search-highlight {
|
||||||
background-color: #FFF2BB;
|
background-color: #FFF2BB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-autocomplete {
|
||||||
|
background-color: #fff;
|
||||||
|
border: $border-gray;
|
||||||
|
line-height: 36px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: scroll;
|
||||||
|
position: absolute;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
@extend %popover-box-shadow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-autocomplete__channel {
|
||||||
|
height: 36px;
|
||||||
|
padding: 0px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-autocomplete__user {
|
||||||
|
height: 36px;
|
||||||
|
padding: 0px;
|
||||||
|
|
||||||
|
.profile-img {
|
||||||
|
height: 32px;
|
||||||
|
margin-right: 6px;
|
||||||
|
width: 32px;
|
||||||
|
@include border-radius(16px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user