|
|
@@ -1,7 +1,6 @@
|
|
1
|
1
|
// @flow
|
|
2
|
2
|
|
|
3
|
3
|
import Button, { ButtonGroup } from '@atlaskit/button';
|
|
4
|
|
-import { withContextFromProps } from '@atlaskit/layer-manager';
|
|
5
|
4
|
import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
|
|
6
|
5
|
import _ from 'lodash';
|
|
7
|
6
|
import PropTypes from 'prop-types';
|
|
|
@@ -71,17 +70,6 @@ type Props = {
|
|
71
|
70
|
width: string
|
|
72
|
71
|
};
|
|
73
|
72
|
|
|
74
|
|
-/**
|
|
75
|
|
- * ContexTypes is used as a workaround for Atlaskit's modal being displayed
|
|
76
|
|
- * outside of the normal App hierarchy, thereby losing context. ContextType
|
|
77
|
|
- * is responsible for taking its props and passing them into children.
|
|
78
|
|
- *
|
|
79
|
|
- * @type {ReactElement}
|
|
80
|
|
- */
|
|
81
|
|
-const ContextProvider = withContextFromProps({
|
|
82
|
|
- i18n: PropTypes.object
|
|
83
|
|
-});
|
|
84
|
|
-
|
|
85
|
73
|
/**
|
|
86
|
74
|
* Web dialog that uses atlaskit modal-dialog to display dialogs.
|
|
87
|
75
|
*/
|
|
|
@@ -136,27 +124,16 @@ class StatelessDialog extends Component<Props> {
|
|
136
|
124
|
onDialogDismissed = { this._onDialogDismissed }
|
|
137
|
125
|
shouldCloseOnEscapePress = { true }
|
|
138
|
126
|
width = { width || 'medium' }>
|
|
139
|
|
- {
|
|
140
|
|
-
|
|
141
|
|
- /**
|
|
142
|
|
- * Wrapping the contents of {@link Modal} with
|
|
143
|
|
- * {@link ContextProvider} is a workaround for the
|
|
144
|
|
- * i18n context becoming undefined as modal gets rendered
|
|
145
|
|
- * outside of the normal react app context.
|
|
146
|
|
- */
|
|
147
|
|
- }
|
|
148
|
|
- <ContextProvider i18n = { this.props.i18n }>
|
|
149
|
|
- <div
|
|
150
|
|
- onKeyDown = { this._onKeyDown }
|
|
151
|
|
- ref = { this._setDialogElement }>
|
|
152
|
|
- <form
|
|
153
|
|
- className = 'modal-dialog-form'
|
|
154
|
|
- id = 'modal-dialog-form'
|
|
155
|
|
- onSubmit = { this._onSubmit }>
|
|
156
|
|
- { children }
|
|
157
|
|
- </form>
|
|
158
|
|
- </div>
|
|
159
|
|
- </ContextProvider>
|
|
|
127
|
+ <div
|
|
|
128
|
+ onKeyDown = { this._onKeyDown }
|
|
|
129
|
+ ref = { this._setDialogElement }>
|
|
|
130
|
+ <form
|
|
|
131
|
+ className = 'modal-dialog-form'
|
|
|
132
|
+ id = 'modal-dialog-form'
|
|
|
133
|
+ onSubmit = { this._onSubmit }>
|
|
|
134
|
+ { children }
|
|
|
135
|
+ </form>
|
|
|
136
|
+ </div>
|
|
160
|
137
|
</Modal>
|
|
161
|
138
|
);
|
|
162
|
139
|
}
|