Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support User: Highlight Masterbar when active #2975

Merged
merged 4 commits into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion client/layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var abtest = require( 'lib/abtest' ).abtest,
Layout;

import { isOffline } from 'state/application/selectors';
import { isSupportUser } from 'state/support/selectors';

if ( config.isEnabled( 'keyboard-shortcuts' ) ) {
KeyboardShortcutsMenu = require( 'lib/keyboard-shortcuts/menu' );
Expand Down Expand Up @@ -99,7 +100,13 @@ Layout = React.createClass( {
},

render: function() {
var sectionClass = 'wp layout is-section-' + this.props.section + ' focus-' + this.props.focus.getCurrent(),
var sectionClass = classnames(
'wp',
'layout',
`is-section-${this.props.section}`,
`focus-${this.props.focus.getCurrent()}`,
{ 'is-support-user': this.props.isSupportUser }
),
showWelcome = this.props.nuxWelcome.getWelcome(),
newestSite = this.newestSite(),
translatorInvitation = this.props.translatorInvitation,
Expand Down Expand Up @@ -145,6 +152,7 @@ export default connect(
const { isLoading, section, hasSidebar, chunkName } = state.ui;
return {
isLoading,
isSupportUser: isSupportUser( state ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better to me, thanks.

section,
hasSidebar,
chunkName,
Expand Down
20 changes: 20 additions & 0 deletions client/layout/masterbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ $autobar-height: 20px;
z-index: z-index( 'root', '.masterbar' );
-webkit-font-smoothing: subpixel-antialiased;

.is-support-user & {
background: $orange-jazzy;
border-bottom: 1px solid darken( $orange-jazzy, 4% );
}

@include breakpoint( ">660px" ) {
backface-visibility: hidden;
}
Expand Down Expand Up @@ -57,6 +62,10 @@ $autobar-height: 20px;
background: $blue-dark;
}

.is-support-user &.is-active {
background: darken( $orange-jazzy, 10% );
}

@include breakpoint( "<480px" ) {
flex: 1 1 auto;

Expand Down Expand Up @@ -104,6 +113,17 @@ $autobar-height: 20px;
display: none;
}

.is-support-user &,
.is-support-user &:focus,
.is-support-user &:hover,
.is-support-user &:visited {
color: $orange-jazzy;
}

.is-support-user &.is-active {
color: $white;
}

@include breakpoint( ">480px" ) {
margin-left: auto;
}
Expand Down
1 change: 1 addition & 0 deletions client/state/support/selectors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

export const getSupportUser = ( state ) => state.support.supportUser;
export const getSupportToken = ( state ) => state.support.supportToken;
export const isSupportUser = ( state ) => !! ( getSupportUser( state ) && getSupportToken( state ) );