@@ -2,8 +2,10 @@ import React from 'react';
22import Button from '@material-ui/core/Button' ;
33import ContentAdd from '@material-ui/icons/Add' ;
44import NavigationMoreHoriz from '@material-ui/icons/MoreHoriz' ;
5- import { Card , CardHeader , CardContent } from '@material-ui/core' ;
6- import FloatingActionButton from '@material-ui/core/Fab' ;
5+ import Card from '@material-ui/core/Card' ;
6+ import CardHeader from '@material-ui/core/CardHeader' ;
7+ import CardContent from '@material-ui/core/CardContent' ;
8+ import Fab from '@material-ui/core/Fab' ;
79import NetPyNECellRule from './NetPyNECellRule' ;
810import NetPyNEThumbnail from '../../general/NetPyNEThumbnail' ;
911import NetPyNESection from './sections/NetPyNESection' ;
@@ -17,27 +19,18 @@ import Dialog from '@material-ui/core/Dialog/Dialog';
1719import Utils from '../../../Utils' ;
1820import NetPyNEHome from '../../general/NetPyNEHome' ;
1921
20- const styles = {
21- rightArrow : {
22- float : 'left' ,
23- color : 'grey' ,
24- fontSize : "20px" ,
25- marginLeft : '15px'
26- } ,
27- cellRule : {
28- marginTop : "15px" ,
29- float : "left" ,
30- textAlign : 'center'
31- } ,
32- sections : {
33- container : {
34- marginLeft : '15px' ,
35- float : 'left' ,
36- borderRadius : 25 ,
37- boxShadow : '0 1px 2px 0 rgba(0, 0, 0, 0.2), 0 3px 6px 0 rgba(0, 0, 0, 0.19)' ,
38- }
39- }
40- }
22+ import DialogActions from '@material-ui/core/DialogActions' ;
23+ import DialogContent from '@material-ui/core/DialogContent' ;
24+ import DialogContentText from '@material-ui/core/DialogContentText' ;
25+ import DialogTitle from '@material-ui/core/DialogTitle' ;
26+
27+ import { withStyles } from '@material-ui/core/styles'
28+
29+ const styles = ( { spacing } ) => ( {
30+ arrowRight : { marginLeft : spacing ( 1 ) } ,
31+ addCellRule : { marginLeft : spacing ( 1 ) } ,
32+ sections : { marginLeft : spacing ( 1 ) }
33+ } )
4134
4235export default class NetPyNECellRules extends React . Component {
4336
@@ -448,8 +441,8 @@ export default class NetPyNECellRules extends React.Component {
448441 switch ( rule ) {
449442 case 'cellRule' :
450443 if ( page !== 'main' ) {
451- if ( selectedCellRule . length > 8 ) {
452- return selectedCellRule . slice ( 0 , 7 ) + '...'
444+ if ( selectedCellRule . length > 6 ) {
445+ return selectedCellRule . slice ( 0 , 5 ) + '...'
453446 } else {
454447 return selectedCellRule
455448 }
@@ -492,23 +485,27 @@ export default class NetPyNECellRules extends React.Component {
492485 let selection = null ;
493486 let container = null ;
494487
495- const actions = (
496- < Button
497- variant = "contained"
498- color = "primary"
499- label = { "BACK" }
500- onTouchTap = { ( ) => this . setState ( { errorMessage : undefined , errorDetails : undefined } ) }
501- />
502- )
503-
504488 const dialogPop = ( errorMessage != undefined
505489 ? < Dialog
506490 title = { errorMessage }
507491 open = { true }
508- actions = { actions }
509- bodyStyle = { { overflow : 'auto' } }
510- style = { { whiteSpace : "pre-wrap" } } >
511- { errorDetails }
492+ style = { { whiteSpace : "pre-wrap" } }
493+ >
494+ < DialogTitle id = "alert-dialog-title" > { errorMessage } </ DialogTitle >
495+ < DialogContent style = { { overflow : 'auto' } } >
496+ < DialogContentText id = "alert-dialog-description" >
497+ { errorDetails }
498+ </ DialogContentText >
499+ </ DialogContent >
500+ < DialogActions >
501+ < Button
502+ variant = "contained"
503+ color = "primary"
504+ onClick = { ( ) => this . setState ( { errorMessage : undefined , errorDetails : undefined } ) }
505+ >
506+ Back
507+ </ Button >
508+ </ DialogActions >
512509 </ Dialog >
513510 : undefined
514511 ) ;
@@ -591,34 +588,42 @@ export default class NetPyNECellRules extends React.Component {
591588 handleClick = { ( ) => this . setState ( { page : 'main' , selectedCellRule : undefined , selectedSection : undefined , selectedMechanism : undefined } ) }
592589 />
593590
594- < FloatingActionButton
595- id = "newCellRuleButton"
596- style = { styles . cellRule }
597- color = { page == 'main' ? 'primary' : 'secondary' }
598- data-tooltip = { this . createTooltip ( 'cellRule' ) }
599- className = { "actionButton smallActionButton" }
600- onClick = { ( ) => this . handleHierarchyClick ( 'main' ) }
601- >
602- { this . createLabel ( 'cellRule' ) }
603- </ FloatingActionButton >
604-
605- < NavigationChevronRight style = { styles . rightArrow } />
606-
607- < Button
608- id = "newSectionButton"
609- variant = "contained"
610- style = { styles . sections . container }
611- color = { page === 'mechanisms' ? 'secondary' : 'primary' }
612- disabled = { selectedCellRule == undefined }
613- onClick = { ( ) => this . handleHierarchyClick ( 'sections' ) }
614- data-tooltip = { this . createTooltip ( 'section' ) }
615- >
616- < p style = { { color : 'white' , height : '100%' } } >
591+ < div className = 'ml-2' >
592+ < Fab
593+ id = "newCellRuleButton"
594+ style = { { minWidth : 56 } }
595+ color = { page == 'main' ? 'primary' : 'secondary' }
596+ data-tooltip = { this . createTooltip ( 'cellRule' ) }
597+ onClick = { ( ) => this . handleHierarchyClick ( 'main' ) }
598+ >
599+ { this . createLabel ( 'cellRule' ) }
600+ </ Fab >
601+ </ div >
602+
603+ < NavigationChevronRight
604+ className = 'ml-2'
605+ color = 'disabled'
606+ />
607+
608+ < div className = 'ml-2' >
609+ < Fab
610+ id = "newSectionButton"
611+ variant = "extended"
612+ style = { { minWidth : '100px' } }
613+ color = { page === 'mechanisms' ? 'secondary' : 'primary' }
614+ disabled = { selectedCellRule == undefined }
615+ onClick = { ( ) => this . handleHierarchyClick ( 'sections' ) }
616+ data-tooltip = { this . createTooltip ( 'section' ) }
617+ >
617618 { this . createLabel ( 'sections' ) }
618- </ p >
619- </ Button >
619+ </ Fab >
620+ </ div >
621+
620622
621- < NavigationChevronRight style = { styles . rightArrow } />
623+ < NavigationChevronRight
624+ className = 'ml-2'
625+ color = 'disabled'
626+ />
622627
623628 < NetPyNENewMechanism
624629 handleClick = { this . handleNewMechanism }
@@ -648,4 +653,4 @@ export default class NetPyNECellRules extends React.Component {
648653 </ Card >
649654 ) ;
650655 }
651- }
656+ }
0 commit comments