initial
This commit is contained in:
parent
aa7c30950c
commit
72716e1c28
41 changed files with 15461 additions and 0 deletions
30
frontend/app/ui.ts
Normal file
30
frontend/app/ui.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import ConfirmationModal from "./components/ConfirmationModal.vue";
|
||||
import type { Runnable } from "./types";
|
||||
|
||||
// A sample global state of the web app
|
||||
export class AppState {
|
||||
constructor(public time: Date) {}
|
||||
}
|
||||
|
||||
export interface NavRoute {
|
||||
title: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface ConfirmationDialog {
|
||||
show(message: string, onSuccess: Runnable): void;
|
||||
}
|
||||
|
||||
export const confirmationDialog: () => ConfirmationDialog = () => {
|
||||
const overlay = useOverlay();
|
||||
const modal = overlay.create(ConfirmationModal);
|
||||
return {
|
||||
async show(message: string, onSuccess: Runnable) {
|
||||
const instance = modal.open({ message: message });
|
||||
const result = await instance.result;
|
||||
if (result) {
|
||||
onSuccess();
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue