diff --git a/desktop/app/src/chrome/BugReporterDialog.tsx b/desktop/app/src/chrome/BugReporterDialog.tsx index be9fdbb83..510cae0b0 100644 --- a/desktop/app/src/chrome/BugReporterDialog.tsx +++ b/desktop/app/src/chrome/BugReporterDialog.tsx @@ -25,13 +25,20 @@ import { styled, } from 'flipper'; import {State as Store} from '../reducers'; - +import LoadingIndicator from '../ui/components/LoadingIndicator'; const Container = styled(FlexColumn)({ padding: 10, width: 400, height: 300, }); +const CenteredContainer = styled(FlexColumn)<{size: number}>(({size}) => ({ + justifyContent: 'center', + alignItems: 'center', + width: size, + height: size, +})); + const Icon = styled(Glyph)({ marginRight: 8, marginLeft: 3, @@ -193,10 +200,14 @@ class BugReporterDialog extends Component { }; onCancel = () => { + if (this.state.submitting) { + this.props.bugReporter.abort(); + } this.setState({ error: null, title: '', description: '', + submitting: false, }); this.props.onHide(); }; @@ -234,79 +245,90 @@ class BugReporterDialog extends Component { ); } else { - content = ( - - Report a bug in Flipper - + if (submitting) { + content = ( + + + + + Submitting... + + +
+ + + +
+
+ ); + } else { + content = ( + + Report a bug in Flipper + - - {activePlugin && activePlugin.bugs && ( - - - - If your bug is related to the{' '} - - {(activePlugin && activePlugin.title) || activePlugin.id}{' '} - plugin - - {activePlugin && activePlugin.bugs && activePlugin.bugs.url && ( - - , you might find useful information about it here:{' '} - - {activePlugin.bugs.url} - - - )} - {activePlugin && activePlugin.bugs && activePlugin.bugs.email && ( - - , you might also want contact{' '} - - {activePlugin.bugs.email} - - , the author/oncall of this plugin, directly - - )} - . - - - )} + + {activePlugin && activePlugin.bugs && ( + + + + If your bug is related to the{' '} + + {(activePlugin && activePlugin.title) || activePlugin.id}{' '} + plugin + + {activePlugin && activePlugin.bugs && activePlugin.bugs.url && ( + + , you might find useful information about it here:{' '} + + {activePlugin.bugs.url} + + + )} + {activePlugin && + activePlugin.bugs && + activePlugin.bugs.email && ( + + , you might also want contact{' '} + + {activePlugin.bugs.email} + + , the author/oncall of this plugin, directly + + )} + . + + + )} -
- {error != null && {error}} - - - - -
-
- ); +
+ {error != null && {error}} + + + + +
+
+ ); + } } - return {content}; } } diff --git a/desktop/app/src/fb-stubs/BugReporter.tsx b/desktop/app/src/fb-stubs/BugReporter.tsx index 6b9a8da01..120f72953 100644 --- a/desktop/app/src/fb-stubs/BugReporter.tsx +++ b/desktop/app/src/fb-stubs/BugReporter.tsx @@ -12,6 +12,9 @@ import {Store} from '../reducers/index'; export default class BugReporter { constructor(_logManager: Logger, _store: Store) {} + public abort() { + console.log('Stub implementation of an abort function.'); + } async report(_title: string, _body: string): Promise { return Promise.resolve(-1); }