[PLT-4374] Added active state for recent mentions and flagged posts. (#6253)

* [PLT-4374] Added active state for recent mentions and flagged posts.

* Increased hover opacity to 0.7 on mention and flag icon.
Этот коммит содержится в:
Kacper Kula
2017-05-09 14:53:47 +02:00
коммит произвёл Joram Wilander
родитель 7a618b8973
Коммит 2b18e782d6
2 изменённых файлов: 15 добавлений и 1 удалений

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

@@ -248,6 +248,8 @@ export default class SearchBar extends React.Component {
let mentionBtn; let mentionBtn;
let flagBtn; let flagBtn;
if (this.props.showMentionFlagBtns) { if (this.props.showMentionFlagBtns) {
var mentionBtnClass = SearchStore.isMentionSearch ? 'active' : '';
mentionBtn = ( mentionBtn = (
<div <div
className='dropdown channel-header__links' className='dropdown channel-header__links'
@@ -262,6 +264,7 @@ export default class SearchBar extends React.Component {
href='#' href='#'
type='button' type='button'
onClick={this.searchMentions} onClick={this.searchMentions}
className={mentionBtnClass}
> >
{'@'} {'@'}
</a> </a>
@@ -269,6 +272,8 @@ export default class SearchBar extends React.Component {
</div> </div>
); );
var flagBtnClass = SearchStore.isFlaggedPosts ? 'active' : '';
flagBtn = ( flagBtn = (
<div <div
className='dropdown channel-header__links' className='dropdown channel-header__links'
@@ -283,6 +288,7 @@ export default class SearchBar extends React.Component {
href='#' href='#'
type='button' type='button'
onClick={this.getFlagged} onClick={this.getFlagged}
className={flagBtnClass}
> >
<span <span
className='icon icon__flag' className='icon icon__flag'

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

@@ -462,12 +462,20 @@
text-decoration: none; text-decoration: none;
&:hover { &:hover {
@include opacity(1); @include opacity(0.7);
} }
&:focus { &:focus {
color: inherit; color: inherit;
} }
&.active {
color: $primary-color;
@include opacity(1);
.icon {
fill: $primary-color;
}
}
} }
} }