From 47f01f92e40e1c33ff1cdf816bb80898090b8194 Mon Sep 17 00:00:00 2001 From: Weslley Araujo Date: Sat, 19 Nov 2016 21:05:48 +0100 Subject: [PATCH] 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` --- lib/components/term-group.js | 1 + lib/components/term.js | 2 +- lib/components/terms.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/components/term-group.js b/lib/components/term-group.js index d5d6a97a..8bba81a4 100644 --- a/lib/components/term-group.js +++ b/lib/components/term-group.js @@ -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, diff --git a/lib/components/term.js b/lib/components/term.js index fa0269e1..85c2a9fb 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -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}} > diff --git a/lib/components/terms.js b/lib/components/terms.js index 33b32be3..76259d62 100644 --- a/lib/components/terms.js +++ b/lib/components/terms.js @@ -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,