Skip to content

Commit

Permalink
[PLT-4374] Added active state for recent mentions and flagged posts. (m…
Browse files Browse the repository at this point in the history
…attermost#6253)

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

* Increased hover opacity to 0.7 on mention and flag icon.
  • Loading branch information
kulak-at authored and jwilander committed May 9, 2017
1 parent 8814657 commit 71cfeeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/search_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ export default class SearchBar extends React.Component {
let mentionBtn;
let flagBtn;
if (this.props.showMentionFlagBtns) {
var mentionBtnClass = SearchStore.isMentionSearch ? 'active' : '';

mentionBtn = (
<div
className='dropdown channel-header__links'
Expand All @@ -262,13 +264,16 @@ export default class SearchBar extends React.Component {
href='#'
type='button'
onClick={this.searchMentions}
className={mentionBtnClass}
>
{'@'}
</a>
</OverlayTrigger>
</div>
);

var flagBtnClass = SearchStore.isFlaggedPosts ? 'active' : '';

flagBtn = (
<div
className='dropdown channel-header__links'
Expand All @@ -283,6 +288,7 @@ export default class SearchBar extends React.Component {
href='#'
type='button'
onClick={this.getFlagged}
className={flagBtnClass}
>
<span
className='icon icon__flag'
Expand Down
10 changes: 9 additions & 1 deletion sass/layout/_headers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,20 @@
text-decoration: none;

&:hover {
@include opacity(1);
@include opacity(0.7);
}

&:focus {
color: inherit;
}

&.active {
color: $primary-color;
@include opacity(1);
.icon {
fill: $primary-color;
}
}
}
}

Expand Down

0 comments on commit 71cfeeb

Please sign in to comment.