@@ -6,6 +6,7 @@ import values from 'lodash/values';
66import bindAll from 'lodash/bindAll' ;
77import includes from 'lodash/includes' ;
88import isNull from 'lodash/isNull' ;
9+ import get from 'lodash/get' ;
910import partial from 'lodash/partial' ;
1011import map from 'lodash/map' ;
1112import { t } from 'i18next' ;
@@ -24,24 +25,23 @@ import {
2425 userLoggedOut ,
2526 hideComponent ,
2627 unhideComponent ,
27- toggleDashboard ,
2828 focusLine ,
2929 editorFocusedRequestedLine ,
3030 dragRowDivider ,
3131 dragColumnDivider ,
3232 startDragColumnDivider ,
3333 stopDragColumnDivider ,
34+ toggleComponent ,
3435 applicationLoaded ,
3536
3637} from '../actions' ;
3738
3839import { isPristineProject } from '../util/projectUtils' ;
3940import { getCurrentProject } from '../selectors' ;
4041
41- import { TopBar , Dashboard , NotificationList } from '../containers' ;
42+ import { TopBar , Instructions , NotificationList } from '../containers' ;
4243import EditorsColumn from './EditorsColumn' ;
4344import Output from './Output' ;
44- import Sidebar from './Sidebar' ;
4545import PopThrobber from './PopThrobber' ;
4646
4747function mapStateToProps ( state ) {
@@ -64,6 +64,7 @@ class Workspace extends React.Component {
6464 bindAll (
6565 this ,
6666 '_handleUnload' ,
67+ '_handleClickInstructionsBar' ,
6768 '_handleComponentUnhide' ,
6869 '_handleComponentHide' ,
6970 '_handleDividerDrag' ,
@@ -72,7 +73,6 @@ class Workspace extends React.Component {
7273 '_handleEditorInput' ,
7374 '_handleEditorsDividerDrag' ,
7475 '_handleErrorClick' ,
75- '_handleToggleDashboard' ,
7676 '_handleRequestedLineFocused' ,
7777 '_storeDividerRef' ,
7878 '_storeColumnRef' ,
@@ -185,10 +185,6 @@ class Workspace extends React.Component {
185185 ) ;
186186 }
187187
188- _handleToggleDashboard ( ) {
189- this . props . dispatch ( toggleDashboard ( ) ) ;
190- }
191-
192188 _handleEditorsDividerDrag ( data ) {
193189 this . props . dispatch ( dragRowDivider ( data ) ) ;
194190 }
@@ -204,14 +200,24 @@ class Workspace extends React.Component {
204200 this . props . dispatch ( editorFocusedRequestedLine ( ) ) ;
205201 }
206202
207- _renderSidebar ( ) {
203+ _handleClickInstructionsBar ( ) {
204+ this . props . dispatch ( toggleComponent (
205+ get ( this . props , [ 'currentProject' , 'projectKey' ] ) ,
206+ 'instructions' ,
207+ ) ) ;
208+ }
209+
210+ _renderInstructionsBar ( ) {
211+ if ( ! get ( this . props , [ 'currentProject' , 'instructions' ] ) ) {
212+ return null ;
213+ }
214+
208215 return (
209- < div className = "layout__sidebar" >
210- < Sidebar
211- dashboardIsOpen = { this . props . ui . dashboard . isOpen }
212- validationState = { this . _getOverallValidationState ( ) }
213- onToggleDashboard = { this . _handleToggleDashboard }
214- />
216+ < div
217+ className = "layout__instructions-bar"
218+ onClick = { this . _handleClickInstructionsBar }
219+ >
220+ < span className = "u__icon" > </ span >
215221 </ div >
216222 ) ;
217223 }
@@ -290,8 +296,8 @@ class Workspace extends React.Component {
290296 < TopBar />
291297 < NotificationList />
292298 < div className = "layout__columns" >
293- < Dashboard />
294- { this . _renderSidebar ( ) }
299+ < Instructions />
300+ { this . _renderInstructionsBar ( ) }
295301 < div className = "workspace layout__main" >
296302 { this . _renderEnvironment ( ) }
297303 </ div >
0 commit comments