diff --git a/dist/index.css b/dist/index.css index 6b3dc083..b7563216 100644 --- a/dist/index.css +++ b/dist/index.css @@ -358,7 +358,6 @@ body[showing-chat] #chat-page-wrapper { } #chat-page > div > #main > div > .pane-wrapper > .pane > .toolbar { height: var(--ribbon-size); - border-top: 1px solid var(--border); overflow-x: auto; padding: 0px; } diff --git a/dist/index.js b/dist/index.js index 92205a52..dc12934f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1425,6 +1425,9 @@ isPresentingSettingsModal = new State(false); isPresentingFilterModal = new State(false); isPresentingNewTaskModal = new State(false); + selectedPage = new State( + "list" /* List */ + ); index = new State(0); // view select = () => { @@ -1730,15 +1733,8 @@ } }; - // src/View/Components/chatViewToggleButton.tsx - function ChatViewToggleButton(label, icon, page, chatViewModel) { - function select() { - chatViewModel.selectedPage.value = page; - } - const isSelected = createProxyState( - [chatViewModel.selectedPage], - () => chatViewModel.selectedPage.value == page - ); + // src/View/Components/ribbonButton.tsx + function RibbonButton(label, icon, isSelected, select) { return /* @__PURE__ */ createElement( "button", { @@ -1751,6 +1747,18 @@ ); } + // src/View/Components/chatViewToggleButton.tsx + function ChatViewToggleButton(label, icon, page, chatViewModel) { + function select() { + chatViewModel.selectedPage.value = page; + } + const isSelected = createProxyState( + [chatViewModel.selectedPage], + () => chatViewModel.selectedPage.value == page + ); + return RibbonButton(label, icon, isSelected, select); + } + // src/View/translations.ts var englishTranslations = { general: { @@ -2160,6 +2168,18 @@ ))), /* @__PURE__ */ createElement("button", { "on:click": boardViewModel.hideSettings }, translations.general.closeButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "close")))); } + // src/View/Components/boardViewToggleButton.tsx + function BoardViewToggleButton(label, icon, page, boardViewModel) { + function select() { + boardViewModel.selectedPage.value = page; + } + const isSelected = createProxyState( + [boardViewModel.selectedPage], + () => boardViewModel.selectedPage.value == page + ); + return RibbonButton(label, icon, isSelected, select); + } + // src/View/ChatPages/boardPage.tsx function BoardPage(boardViewModel) { return /* @__PURE__ */ createElement("div", { class: "pane" }, /* @__PURE__ */ createElement("div", { class: "toolbar" }, /* @__PURE__ */ createElement("span", null, /* @__PURE__ */ createElement( @@ -2178,30 +2198,21 @@ "on:click": boardViewModel.showSettings }, /* @__PURE__ */ createElement("span", { class: "icon" }, "settings") - )), /* @__PURE__ */ createElement("span", { class: "scroll-h ribbon" }, /* @__PURE__ */ createElement( - "button", - { - class: "ghost ribbon-button", - "aria-label": translations.chatPage.task.listViewButtonAudioLabel, - "on:click": boardViewModel.close - }, - /* @__PURE__ */ createElement("span", { class: "icon" }, "view_list") - ), /* @__PURE__ */ createElement( - "button", - { - class: "ghost ribbon-button", - "aria-label": translations.chatPage.task.kanbanViewButtonAudioLabel, - "on:click": boardViewModel.showSettings - }, - /* @__PURE__ */ createElement("span", { class: "icon" }, "view_kanban") - ), /* @__PURE__ */ createElement( - "button", - { - class: "ghost ribbon-button", - "aria-label": translations.chatPage.task.statusViewButtonAudioLabel, - "on:click": boardViewModel.showSettings - }, - /* @__PURE__ */ createElement("span", { class: "icon" }, "grid_view") + )), /* @__PURE__ */ createElement("span", { class: "scroll-h ribbon" }, BoardViewToggleButton( + translations.chatPage.task.listViewButtonAudioLabel, + "view_list", + "list" /* List */, + boardViewModel + ), BoardViewToggleButton( + translations.chatPage.task.kanbanViewButtonAudioLabel, + "view_kanban", + "kanban" /* Kanban */, + boardViewModel + ), BoardViewToggleButton( + translations.chatPage.task.statusViewButtonAudioLabel, + "grid_view", + "status-grid" /* StatusGrid */, + boardViewModel )), /* @__PURE__ */ createElement("span", null, /* @__PURE__ */ createElement( "button", { diff --git a/src/View/ChatPages/boardPage.tsx b/src/View/ChatPages/boardPage.tsx index af15bd82..c042965d 100644 --- a/src/View/ChatPages/boardPage.tsx +++ b/src/View/ChatPages/boardPage.tsx @@ -1,7 +1,11 @@ import * as React from "bloatless-react"; +import BoardViewModel, { + BoardPageType, +} from "../../ViewModel/Pages/boardViewModel"; + import { BoardSettingsModal } from "../Modals/boardSettingsModal"; -import BoardViewModel from "../../ViewModel/Pages/boardViewModel"; +import { BoardViewToggleButton } from "../Components/boardViewToggleButton"; import { translations } from "../translations"; export function BoardPage(boardViewModel: BoardViewModel) { @@ -25,27 +29,24 @@ export function BoardPage(boardViewModel: BoardViewModel) { - - - + {BoardViewToggleButton( + translations.chatPage.task.listViewButtonAudioLabel, + "view_list", + BoardPageType.List, + boardViewModel + )} + {BoardViewToggleButton( + translations.chatPage.task.kanbanViewButtonAudioLabel, + "view_kanban", + BoardPageType.Kanban, + boardViewModel + )} + {BoardViewToggleButton( + translations.chatPage.task.statusViewButtonAudioLabel, + "grid_view", + BoardPageType.StatusGrid, + boardViewModel + )} - ); + return RibbonButton(label, icon, isSelected, select); } diff --git a/src/View/Components/ribbonButton.tsx b/src/View/Components/ribbonButton.tsx new file mode 100644 index 00000000..0d116408 --- /dev/null +++ b/src/View/Components/ribbonButton.tsx @@ -0,0 +1,23 @@ +import * as React from "bloatless-react"; + +import BoardViewModel, { + BoardPageType, +} from "../../ViewModel/Pages/boardViewModel"; + +export function RibbonButton( + label: string, + icon: string, + isSelected: React.State, + select: () => void +) { + return ( + + ); +} diff --git a/src/View/chatPage.css b/src/View/chatPage.css index a522a890..579a3b16 100644 --- a/src/View/chatPage.css +++ b/src/View/chatPage.css @@ -184,8 +184,6 @@ body[showing-chat] #chat-page-wrapper { #chat-page > div > #main > div > .pane-wrapper > .pane > .toolbar { height: var(--ribbon-size); - border-top: 1px solid var(--border); - overflow-x: auto; padding: 0px; diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index 29dfcbfe..8717792c 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -19,6 +19,10 @@ export default class BoardViewModel { isPresentingFilterModal: React.State = new React.State(false); isPresentingNewTaskModal: React.State = new React.State(false); + selectedPage: React.State = new React.State( + BoardPageType.List + ); + index: React.State = new React.State(0); // view @@ -111,3 +115,10 @@ export default class BoardViewModel { }); } } + +// types +export enum BoardPageType { + List = "list", + Kanban = "kanban", + StatusGrid = "status-grid", +}