prepare calendar view
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { Chat, MessageObject } from "../../Model/chatModel";
|
||||
|
||||
import { ObjectGridView } from "./objectGridView";
|
||||
|
||||
export function CalendarView(
|
||||
chat: Chat,
|
||||
messageObjects: React.MapState<MessageObject>,
|
||||
selectedObject: React.State<MessageObject | undefined>,
|
||||
isShowingObjectModal: React.State<boolean>
|
||||
) {
|
||||
const notes = new React.ListState<MessageObject>();
|
||||
messageObjects.handleAddition((messageObject) => {
|
||||
const latest = chat.getMostRecentContent(messageObject);
|
||||
if (!latest) return;
|
||||
if (!latest.date) return;
|
||||
|
||||
notes.add(messageObject);
|
||||
messageObjects.handleRemoval(messageObject, () =>
|
||||
notes.remove(messageObject)
|
||||
);
|
||||
});
|
||||
|
||||
return <div class="width-100 height-100 scroll-v padding">
|
||||
{ObjectGridView(chat, notes, selectedObject, isShowingObjectModal)}
|
||||
</div>;
|
||||
}
|
||||
@@ -12,12 +12,14 @@ import { icons } from "../../icons";
|
||||
import { translation } from "../../translations";
|
||||
import { previousObjectSearches } from "../../Model/model";
|
||||
import { stringToOptionTag } from "../../utility";
|
||||
import { CalendarView } from "./calendarView";
|
||||
|
||||
export const viewTypes = {
|
||||
all: [translation.viewAll, "grid_view"],
|
||||
notes: [translation.viewNotes, icons.noteContent],
|
||||
kanban: [translation.viewKanban, "view_kanban"],
|
||||
status: [translation.viewStatus, icons.status],
|
||||
calendar: [translation.viewCalendar, icons.date],
|
||||
};
|
||||
|
||||
export function ObjectPane(chat: Chat) {
|
||||
@@ -143,6 +145,8 @@ export function ObjectPane(chat: Chat) {
|
||||
return KanbanView;
|
||||
case "status":
|
||||
return StatusView;
|
||||
case "calendar":
|
||||
return CalendarView;
|
||||
default:
|
||||
return AllObjectsView;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user