@@ -12,7 +12,25 @@ import DialogTitle from '@material-ui/core/DialogTitle';
1212
1313import FileBrowser from '../../general/FileBrowser' ;
1414
15- const styles = {
15+ import { withStyles } from '@material-ui/core/styles' ;
16+
17+ const styles = ( { spacing, typography, zIndex } ) => ( {
18+ container : {
19+ marginTop : spacing ( 2 ) ,
20+ display : 'flex' ,
21+ flexDirection : 'row' ,
22+ alignItems : 'flex-end' ,
23+ width : '100%'
24+ } ,
25+ icon : {
26+ '&:hover' : { backgroundColor : 'inherit' } ,
27+ flex : '0 0 4%' ,
28+ marginRight : spacing ( 2 ) ,
29+ width : typography . h3 . fontSize ,
30+ height : typography . h3 . fontSize ,
31+ padding : '0px!important' ,
32+ zIndex : zIndex . modal
33+ } ,
1634 input : {
1735 outline : 'none' ,
1836 border : 'none' ,
@@ -23,8 +41,9 @@ const styles = {
2341 boxShadow : 'none' ,
2442 }
2543 }
26- }
27- export default class UploadDownloadFile extends React . Component {
44+ } )
45+
46+ class UploadDownloadFile extends React . Component {
2847 constructor ( props ) {
2948 super ( props ) ;
3049 this . state = this . initialState ( )
@@ -175,19 +194,19 @@ export default class UploadDownloadFile extends React.Component {
175194
176195
177196 render ( ) {
197+ const { classes } = this . props
178198 const { mode } = this . props
179199
180200 switch ( mode ) {
181201 case 'UPLOAD' :
182202 var content = (
183203 < div >
184- < div className = "flex-row" >
204+ < div className = { classes . container } >
185205 < div >
186206 < input
187207 multiple
188208 type = "file"
189- style = { { ...styles . input } }
190- className = "form-control"
209+ className = { classes . input }
191210 onChange = { this . onUploadFileArrayChange }
192211 />
193212
@@ -203,16 +222,16 @@ export default class UploadDownloadFile extends React.Component {
203222 case 'DOWNLOAD' :
204223 var content = (
205224 < div >
206- < div className = "flex-row" >
225+ < div className = { classes . container } >
207226 < IconButton
208- className = 'flex-row- icon'
227+ className = { classes . icon }
209228 onClick = { ( ) => this . showExplorerDialog ( '.py' ) }
210229 tooltip-data = 'File explorer'
211230 >
212231 < Icon className = { 'fa fa-folder-o listIcon' } />
213232 </ IconButton >
214233 < TextField
215- className = "netpyneFieldNoWidth fx-11 no-z-index"
234+ className = 'netpyneField'
216235 value = { this . state . downloadPathsDisplayText }
217236 onChange = { event => this . changeDownloadFilePathsDisplayText ( event . target . value ) }
218237 label = "Files:"
@@ -271,4 +290,6 @@ export default class UploadDownloadFile extends React.Component {
271290
272291 )
273292 }
274- }
293+ }
294+
295+ export default withStyles ( styles ) ( UploadDownloadFile )
0 commit comments