add placeholder view for kanban
This commit is contained in:
@@ -15,8 +15,7 @@ export function AllObjectsView(
|
||||
chat,
|
||||
chat.objects,
|
||||
selectedObject,
|
||||
isShowingObjectModal,
|
||||
translation.noObjects
|
||||
isShowingObjectModal
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Chat, MessageObject } from "../../Model/chatModel";
|
||||
|
||||
import { ObjectEntryView } from "./objectEntryView";
|
||||
import { ObjectGridView } from "./objectGridView";
|
||||
import { PlaceholderView } from "./placeholderView";
|
||||
import { translation } from "../../translations";
|
||||
|
||||
interface KanbanBoard {
|
||||
@@ -33,15 +34,19 @@ export function KanbanView(
|
||||
});
|
||||
});
|
||||
|
||||
const content = React.createProxyState([chat.objects], () => (
|
||||
<div class="flex-row large-gap width-100 height-100 scroll-v scroll-h padding">
|
||||
{...[...boards.value.values()]
|
||||
.sort((a, b) => a.title.localeCompare(b.title))
|
||||
.map((board) =>
|
||||
KanbanBoardView(chat, board, selectedObject, isShowingObjectModal)
|
||||
)}
|
||||
</div>
|
||||
));
|
||||
const content = React.createProxyState([chat.objects], () =>
|
||||
boards.value.size == 0 ? (
|
||||
PlaceholderView()
|
||||
) : (
|
||||
<div class="flex-row large-gap width-100 height-100 scroll-v scroll-h padding">
|
||||
{...[...boards.value.values()]
|
||||
.sort((a, b) => a.title.localeCompare(b.title))
|
||||
.map((board) =>
|
||||
KanbanBoardView(chat, board, selectedObject, isShowingObjectModal)
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="width-100 height-100 scroll-no" children:set={content}></div>
|
||||
|
||||
@@ -26,8 +26,7 @@ export function NoteObjectsView(
|
||||
chat,
|
||||
notes,
|
||||
selectedObject,
|
||||
isShowingObjectModal,
|
||||
translation.noNotes
|
||||
isShowingObjectModal
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import * as React from "bloatless-react";
|
||||
import { Chat, MessageObject } from "../../Model/chatModel";
|
||||
|
||||
import { ObjectEntryView } from "./objectEntryView";
|
||||
import { PlaceholderView } from "./placeholderView";
|
||||
|
||||
export function ObjectGridView(
|
||||
chat: Chat,
|
||||
@@ -10,8 +11,7 @@ export function ObjectGridView(
|
||||
| React.ListState<MessageObject>
|
||||
| React.MapState<MessageObject>,
|
||||
selectedObject: React.State<MessageObject | undefined>,
|
||||
isShowingObjectModal: React.State<boolean>,
|
||||
placeholderText: string
|
||||
isShowingObjectModal: React.State<boolean>
|
||||
) {
|
||||
const objectConverter: React.StateItemConverter<MessageObject> = (
|
||||
messageObject
|
||||
@@ -25,9 +25,7 @@ export function ObjectGridView(
|
||||
};
|
||||
|
||||
return messageObjects.value.size == 0 ? (
|
||||
<div class="flex-column width-100 height-100 align-center justify-center secondary">
|
||||
{placeholderText}
|
||||
</div>
|
||||
PlaceholderView()
|
||||
) : (
|
||||
<div
|
||||
class="width-100 grid gap padding scroll-v"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { translation } from "../../translations";
|
||||
|
||||
export function PlaceholderView() {
|
||||
return <div class="flex-column width-100 height-100 align-center justify-center secondary">
|
||||
{translation.noObjects}
|
||||
</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user