2017-09-27 02:42:18 +08:00
|
|
|
import { React } from 'mailspring-exports';
|
2017-09-27 02:46:00 +08:00
|
|
|
import { Notification } from 'mailspring-component-kit';
|
2016-10-04 23:02:11 +08:00
|
|
|
|
|
|
|
export default class DevModeNotification extends React.Component {
|
|
|
|
static displayName = 'DevModeNotification';
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
// Don't need listeners to update this, since toggling dev mode reloads
|
|
|
|
// the entire window anyway
|
|
|
|
this.state = {
|
2017-09-27 02:36:58 +08:00
|
|
|
inDevMode: AppEnv.inDevMode(),
|
2017-09-27 02:33:08 +08:00
|
|
|
};
|
2016-10-04 23:02:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
if (!this.state.inDevMode) {
|
2017-09-27 02:33:08 +08:00
|
|
|
return <span />;
|
2016-10-04 23:02:11 +08:00
|
|
|
}
|
|
|
|
return (
|
2017-09-27 02:33:08 +08:00
|
|
|
<Notification priority="0" title="Mailspring is running in dev mode and may be slower!" />
|
|
|
|
);
|
2016-10-04 23:02:11 +08:00
|
|
|
}
|
|
|
|
}
|