11import React from "react" ;
22import Toolbar from "@material-ui/core/Toolbar" ;
3- import Transition from "./transition/Transition" ;
3+
44import {
5- NetPyNESynapses ,
6- NetPyNEConnectivityRules ,
7- NetPyNECellRules ,
8- NetPyNEStimulationSources ,
9- NetPyNEStimulationTargets ,
10- NetPyNESimConfig ,
115 NetPyNEToolBar ,
126 NetPyNETabs ,
13- NetPyNEPopulations ,
147 LayoutManager ,
15- NetPyNEPlots
168} from "netpyne/components" ;
179
18- export default class NetPyNE extends React . Component {
10+ import { withStyles } from '@material-ui/core/styles'
11+
12+ const styles = ( { zIndex, palette, spacing } ) => ( {
13+ container : {
14+ height : "100%" ,
15+ width : "100%" ,
16+ display : "flex" ,
17+ flexDirection : "column"
18+ } ,
19+ toolbar : {
20+ backgroundColor : palette . primary . main ,
21+ width : "100%" ,
22+ boxShadow : "0 0px 4px 0 rgba(0, 0, 0, 0.2), 0 0px 8px 0 rgba(0, 0, 0, 0.19)" ,
23+ position : "relative" ,
24+ top : 0 ,
25+ left : 0 ,
26+ zIndex : zIndex . appBar
27+ } ,
28+ views : {
29+ display : "flex" ,
30+ flexFlow : "rows" ,
31+ width : "100%" ,
32+ marginRight : spacing ( - 1 )
33+ } ,
34+ drawer : { marginLeft : spacing ( - 1 ) } ,
35+ content : { position : "relative" , zIndex : zIndex . appBar }
36+ } )
37+ class NetPyNE extends React . Component {
1938 constructor ( props ) {
2039 super ( props ) ;
2140 this . widgets = { } ;
@@ -50,79 +69,29 @@ export default class NetPyNE extends React.Component {
5069 if ( ! this . props . data ) {
5170 return < div > </ div > ;
5271 } else {
72+ const { classes } = this . props
5373 if ( this . props . editMode ) {
54- var content = (
55- < div style = { { marginBottom : "50px" } } >
56- < NetPyNEPopulations model = { "netParams.popParams" } />
57- < NetPyNECellRules model = { "netParams.cellParams" } />
58- < NetPyNESynapses model = { "netParams.synMechParams" } />
59- < NetPyNEConnectivityRules model = { "netParams.connParams" } />
60- < NetPyNEStimulationSources model = { "netParams.stimSourceParams" } />
61- < NetPyNEStimulationTargets model = { "netParams.stimTargetParams" } />
62- < NetPyNESimConfig model = { this . props . data . simConfig } />
63- < NetPyNEPlots model = { "simConfig.analysis" } />
64- </ div >
65- ) ;
74+ var content = < LayoutManager /> ;
6675 } else {
6776 var content = < LayoutManager /> ;
6877 }
6978
7079 return (
71- < div
72- style = { {
73- height : "100%" ,
74- width : "100%" ,
75- display : "flex" ,
76- flexDirection : "column"
77- } }
78- >
79- < div style = { { position : "relative" , zIndex : "100" } } >
80- < Toolbar
81- id = "appBar"
82- style = { {
83- backgroundColor : "#543a73" ,
84- width : "100%" ,
85- boxShadow :
86- "0 0px 4px 0 rgba(0, 0, 0, 0.2), 0 0px 8px 0 rgba(0, 0, 0, 0.19)" ,
87- position : "relative" ,
88- top : "0px" ,
89- left : "0px" ,
90- zIndex : 100
91- } }
92- >
93- < div style = { { marginLeft : - 12 } } >
80+ < div className = { classes . container } >
81+ < div className = { classes . content } >
82+ < Toolbar id = "appBar" className = { classes . toolbar } >
83+ < div className = { classes . drawer } >
9484 < NetPyNEToolBar />
9585 </ div >
96- < div
97- style = { {
98- display : "flex" ,
99- flexFlow : "rows" ,
100- width : "100%" ,
101- marginRight : - 10
102- } }
103- >
86+ < div className = { classes . views } >
10487 < NetPyNETabs />
10588 </ div >
10689 </ Toolbar >
10790 </ div >
108-
109- { /** TODO Reengineer Transition using the middleware to handle simulation and instantiation. The transition should only show content related to what actually we want to do
110- <Transition
111- tab={this.state.value}
112- clickOnTab={this.state.tabClicked}
113- handleDeactivateInstanceUpdate={this.handleDeactivateInstanceUpdate}
114- handleDeactivateSimulationUpdate={
115- this.handleDeactivateSimulationUpdate
116- }
117- freezeInstance={this.state.freezeInstance}
118- freezeSimulation={this.state.freezeSimulation}
119- fastForwardInstantiation={this.state.fastForwardInstantiation}
120- fastForwardSimulation={this.state.fastForwardSimulation}
121- /> */ }
122-
12391 { content }
12492 </ div >
12593 ) ;
12694 }
12795 }
12896}
97+ export default withStyles ( styles ) ( NetPyNE )
0 commit comments