1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/ElectronClient/gui/MainScreen/commands/showModalMessage.tsx
Laurent Cozic 3a57cfea02 Desktop: Simplified and improve command service, and added command palette
- Commands "enabled" state is now expressed using a "when-clause" like in VSCode
- A command palette has been added to the Tools menu
2020-10-18 21:52:10 +01:00

24 lines
570 B
TypeScript

import * as React from 'react';
import { CommandDeclaration, CommandRuntime, CommandContext } from 'lib/services/CommandService';
export const declaration:CommandDeclaration = {
name: 'showModalMessage',
};
export const runtime = (comp:any):CommandRuntime => {
return {
execute: async (_context:CommandContext, message:string) => {
comp.setState({
modalLayer: {
visible: true,
message:
<div className="modal-message">
<div id="loading-animation" />
<div className="text">{message}</div>
</div>,
},
});
},
};
};