File tree Expand file tree Collapse file tree
webapp/components/topbar/dialogs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,15 +72,25 @@ class ActionDialog extends React.Component {
7272 if ( errorMessage === '' ) {
7373 title = this . props . title ;
7474 action = (
75- < Button
76- id = "appBarPerformActionButton"
77- key = "appBarPerformActionButton"
78- variant = "contained"
79- color = "primary"
80- onClick = { this . performAction }
75+ < >
76+ < Button
77+ onClick = { this . cancelDialog }
78+ style = { styles . cancel }
79+ key = "CANCEL"
8180 >
82- { this . props . buttonLabel }
81+ CANCEL
8382 </ Button >
83+ < Button
84+ id = "appBarPerformActionButton"
85+ key = "appBarPerformActionButton"
86+ variant = "contained"
87+ color = "primary"
88+ onClick = { this . performAction }
89+ >
90+ { this . props . buttonLabel }
91+ </ Button >
92+ </ >
93+
8494 ) ;
8595
8696 content = this . props . children ;
@@ -89,10 +99,10 @@ class ActionDialog extends React.Component {
8999 < Button
90100 variant = "contained"
91101 color = "primary"
92- key = "BACK "
102+ key = "CLOSE "
93103 onClick = { ( ) => this . handleClickGoBack ( ) }
94104 >
95- BACK
105+ CLOSE
96106 </ Button >
97107 ) ;
98108
@@ -102,11 +112,13 @@ class ActionDialog extends React.Component {
102112 }
103113 }
104114
115+ const shouldDisplay = Boolean ( ! this . state . hide || this . props . openErrorDialogBox ) ;
105116 return (
117+ shouldDisplay ?(
106118 < Dialog
107119 fullWidth
108120 maxWidth = { this . props . openErrorDialogBox ? 'md' : 'sm' }
109- open = { Boolean ( ! this . state . hide || this . props . openErrorDialogBox ) }
121+ open = { shouldDisplay }
110122 onClose = { ( ) => this . cancelDialog ( ) }
111123 className = { classes . root }
112124 >
@@ -115,16 +127,10 @@ class ActionDialog extends React.Component {
115127 { content }
116128 </ DialogContent >
117129 < DialogActions >
118- < Button
119- onClick = { this . cancelDialog }
120- style = { styles . cancel }
121- key = "CANCEL"
122- >
123- CANCEL
124- </ Button >
125130 { action }
126131 </ DialogActions >
127132 </ Dialog >
133+ ) : < > </ >
128134 ) ;
129135 }
130136}
You can’t perform that action at this time.
0 commit comments