Files
notebrook-notes/frontend/src/dialogs/create-channel.ts

22 lines
678 B
TypeScript
Raw Normal View History

2024-09-03 14:50:33 +02:00
import { API } from "../api";
import { showToast } from "../speech";
import { TextInput } from "../ui";
import { Dialog } from "../ui/dialog";
export class CreateChannelDialog extends Dialog<string> {
private nameField: TextInput;
public constructor() {
super("Create new channel");
this.nameField = new TextInput("Name of new channel");
this.add(this.nameField);
this.setOkAction(() => {
return this.nameField.getValue();
});
this.nameField.onKeyDown((key) => {
if (key === "Enter") {
this.choose(this.nameField.getValue());
}
});
}
}