Add an active class on current session panel (#905)

* feat(session): add session_active class to panels

* fix(active-session): rename active session class

see #905

* fix(active-session): rename prop name to `isTermActive`
This commit is contained in:
Weslley Araujo 2016-11-19 21:05:48 +01:00 committed by Matheus Fernandes
parent 85968b71b3
commit 47f01f92e4
3 changed files with 3 additions and 1 deletions

View file

@ -48,6 +48,7 @@ class TermGroup_ extends Component {
const session = this.props.sessions[uid];
const termRef = this.props.terms[uid];
const props = getTermProps(uid, this.props, {
isTermActive: uid === this.props.activeSession,
term: termRef ? termRef.term : null,
customCSS: this.props.customCSS,
fontSize: this.props.fontSize,

View file

@ -336,7 +336,7 @@ export default class Term extends Component {
ref={component => {
this.termWrapperRef = component;
}}
className={css('fit')}
className={css('fit', this.props.isTermActive && 'active')}
onMouseDown={this.handleMouseDown}
style={{padding: this.props.padding}}
>

View file

@ -84,6 +84,7 @@ export default class Terms extends Component {
const props = getTermGroupProps(uid, this.props, {
termGroup,
terms: this.terms,
activeSession: this.props.activeSession,
sessions: this.props.sessions,
customCSS: this.props.customCSS,
fontSize: this.props.fontSize,