fix imports

This commit is contained in:
marlon-erler
2024-07-22 20:02:13 +02:00
parent 84b6550cf3
commit 7c4558a5b2
4 changed files with 45 additions and 8 deletions
+36 -1
View File
@@ -1,3 +1,38 @@
import * as React from "bloatless-react";
export default class TaskViewModel {}
import TaskModel, {
BoardInfoFileContent,
TaskFileContent,
} from "../../Model/Files/taskModel";
import StorageModel from "../../Model/Global/storageModel";
export default class TaskViewModel {
taskModel: TaskModel;
storageModel: StorageModel;
// state
newBoardNameInput: React.State<string> = new React.State("");
boards: React.ListState<BoardInfoFileContent> = new React.ListState();
// guards
cannotCreateBoard: React.State<boolean> = React.createProxyState(
[this.newBoardNameInput],
() => this.newBoardNameInput.value == ""
);
// methods
createBoard = (): void => {
if (this.cannotCreateBoard.value == true) return;
this.taskModel.createBoard(this.newBoardNameInput.value);
this.newBoardNameInput.value = "";
};
// init
constructor(taskModel: TaskModel, storageModel: StorageModel) {
this.taskModel = taskModel;
this.storageModel = storageModel;
}
}