mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 07:16:01 +00:00
connection modal
This commit is contained in:
11
packages/web/src/modals/modalTools.ts
Normal file
11
packages/web/src/modals/modalTools.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { openedModals } from '../stores';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
|
||||
export function showModal(component, props = {}) {
|
||||
const modalId = uuidv1();
|
||||
openedModals.update(x => [...x, { component, modalId, props }]);
|
||||
}
|
||||
|
||||
export function closeModal(modalId) {
|
||||
openedModals.update(x => x.filter(y => y.modalId != modalId));
|
||||
}
|
||||
Reference in New Issue
Block a user