|
|
@@ -1,5 +1,4 @@
|
|
1
|
|
-import AKButton from '@atlaskit/button';
|
|
2
|
|
-import AKButtonGroup from '@atlaskit/button-group';
|
|
|
1
|
+import Button, { ButtonGroup } from '@atlaskit/button';
|
|
3
|
2
|
import ModalDialog from '@atlaskit/modal-dialog';
|
|
4
|
3
|
import { AtlasKitThemeProvider } from '@atlaskit/theme';
|
|
5
|
4
|
import PropTypes from 'prop-types';
|
|
|
@@ -189,12 +188,14 @@ class StatelessDialog extends Component {
|
|
189
|
188
|
}
|
|
190
|
189
|
|
|
191
|
190
|
return (
|
|
192
|
|
- <AKButton
|
|
|
191
|
+ <Button
|
|
193
|
192
|
appearance = 'subtle'
|
|
194
|
193
|
id = { CANCEL_BUTTON_ID }
|
|
195
|
|
- onClick = { this._onCancel }>
|
|
|
194
|
+ key = 'cancel'
|
|
|
195
|
+ onClick = { this._onCancel }
|
|
|
196
|
+ type = 'button'>
|
|
196
|
197
|
{ this.props.t(this.props.cancelTitleKey || 'dialog.Cancel') }
|
|
197
|
|
- </AKButton>
|
|
|
198
|
+ </Button>
|
|
198
|
199
|
);
|
|
199
|
200
|
}
|
|
200
|
201
|
|
|
|
@@ -205,12 +206,18 @@ class StatelessDialog extends Component {
|
|
205
|
206
|
* @returns {ReactElement}
|
|
206
|
207
|
*/
|
|
207
|
208
|
_renderFooter() {
|
|
|
209
|
+ // Filter out falsy (null) values because {@code ButtonGroup} will error
|
|
|
210
|
+ // if passed in anything but buttons with valid type props.
|
|
|
211
|
+ const buttons = [
|
|
|
212
|
+ this._renderCancelButton(),
|
|
|
213
|
+ this._renderOKButton()
|
|
|
214
|
+ ].filter(Boolean);
|
|
|
215
|
+
|
|
208
|
216
|
return (
|
|
209
|
217
|
<footer className = 'modal-dialog-footer'>
|
|
210
|
|
- <AKButtonGroup>
|
|
211
|
|
- { this._renderCancelButton() }
|
|
212
|
|
- { this._renderOKButton() }
|
|
213
|
|
- </AKButtonGroup>
|
|
|
218
|
+ <ButtonGroup>
|
|
|
219
|
+ { buttons }
|
|
|
220
|
+ </ButtonGroup>
|
|
214
|
221
|
</footer>
|
|
215
|
222
|
);
|
|
216
|
223
|
}
|
|
|
@@ -245,14 +252,16 @@ class StatelessDialog extends Component {
|
|
245
|
252
|
}
|
|
246
|
253
|
|
|
247
|
254
|
return (
|
|
248
|
|
- <AKButton
|
|
|
255
|
+ <Button
|
|
249
|
256
|
appearance = 'primary'
|
|
250
|
257
|
form = 'modal-dialog-form'
|
|
251
|
258
|
id = { OK_BUTTON_ID }
|
|
252
|
259
|
isDisabled = { this.props.okDisabled }
|
|
253
|
|
- onClick = { this._onSubmit }>
|
|
|
260
|
+ key = 'submit'
|
|
|
261
|
+ onClick = { this._onSubmit }
|
|
|
262
|
+ type = 'button'>
|
|
254
|
263
|
{ this.props.t(this.props.okTitleKey || 'dialog.Ok') }
|
|
255
|
|
- </AKButton>
|
|
|
264
|
+ </Button>
|
|
256
|
265
|
);
|
|
257
|
266
|
}
|
|
258
|
267
|
|