2026-04-18 11:55:01 +00:00
|
|
|
import { ViewController } from "../viewController";
|
2026-09-29 22:24:34 +02:00
|
|
|
import { CommonKeys, getKeySymbol } from "../keystrokes";
|
2024-07-23 14:31:50 +02:00
|
|
|
import { DangerousActionButton } from "../Components/dangerousActionButton";
|
2026-04-18 11:55:01 +00:00
|
|
|
import { ColorPicker } from "../Components/colorPicker";
|
2026-09-23 00:09:09 +02:00
|
|
|
import * as React from "../../react";
|
2026-04-18 11:55:01 +00:00
|
|
|
import BoardViewModel from "../../ViewModel/Pages/boardViewModel";
|
2026-04-09 16:48:22 +00:00
|
|
|
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
|
2024-07-23 13:09:46 +02:00
|
|
|
|
2026-04-09 16:48:22 +00:00
|
|
|
export function BoardSettingsModal(
|
|
|
|
|
coreViewModel: CoreViewModel,
|
|
|
|
|
boardViewModel: BoardViewModel,
|
|
|
|
|
) {
|
2026-04-15 12:47:10 +00:00
|
|
|
boardViewModel.isPresentingSettingsModal.subscribe(
|
|
|
|
|
ViewController.setFocusWithDelay,
|
|
|
|
|
);
|
2026-04-13 11:23:17 +00:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
class="modal"
|
|
|
|
|
toggle:open={boardViewModel.isPresentingSettingsModal}
|
|
|
|
|
>
|
2024-07-23 13:19:08 +02:00
|
|
|
<div>
|
2026-04-01 08:29:39 +00:00
|
|
|
<main>
|
2026-04-09 16:48:22 +00:00
|
|
|
<h2>
|
|
|
|
|
{
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.boardSettingsHeadline
|
|
|
|
|
}
|
|
|
|
|
</h2>
|
2024-07-23 13:48:17 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
<label class="tile flex-no">
|
|
|
|
|
<span class="icon">label</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span>
|
2026-04-09 16:48:22 +00:00
|
|
|
{
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.boardNameInputLabel
|
|
|
|
|
}
|
2026-04-01 08:29:39 +00:00
|
|
|
</span>
|
|
|
|
|
<input
|
2026-04-13 11:23:17 +00:00
|
|
|
id="focused"
|
2026-04-01 08:29:39 +00:00
|
|
|
on:enter={boardViewModel.saveSettings}
|
|
|
|
|
bind:value={boardViewModel.name}
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
</label>
|
2024-07-23 14:31:50 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
<hr></hr>
|
2024-07-23 14:31:50 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
{ColorPicker(boardViewModel.color)}
|
2024-07-23 14:31:50 +02:00
|
|
|
|
2026-04-01 08:29:39 +00:00
|
|
|
<hr></hr>
|
|
|
|
|
|
|
|
|
|
<div class="width-input">
|
|
|
|
|
{DangerousActionButton(
|
2026-04-09 16:48:22 +00:00
|
|
|
coreViewModel,
|
|
|
|
|
coreViewModel.translations.chatPage.task
|
|
|
|
|
.deleteBoardButton,
|
2026-04-01 08:29:39 +00:00
|
|
|
"delete_forever",
|
|
|
|
|
boardViewModel.deleteBoard,
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
2026-09-29 22:24:34 +02:00
|
|
|
<button
|
|
|
|
|
on:click={boardViewModel.hideSettings}
|
|
|
|
|
ctkeystroke={getKeySymbol(CommonKeys.Apply)}
|
|
|
|
|
>
|
2026-04-09 16:48:22 +00:00
|
|
|
{coreViewModel.translations.general.closeButton}
|
2026-04-01 08:29:39 +00:00
|
|
|
<span class="icon">close</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-23 13:09:46 +02:00
|
|
|
}
|