import { WorkspaceLeaf , ItemView } from "obsidian" ; import { CALENDAR_VIEW_TYPE } from './data/constants' ; import React from "react" ; import ReactDOM from "react-dom" ; import { closeTaskTimerID , closeTimerID } from "./ui/BigCalendarView" ; import { reactPreview } from './ui/BigCalendarView' ; import type BigCalendarPlugin from './index' ; import { outputTasksResults } from "./data/parseFileTasks" ; export class BigCalendar extends ItemView { plugin : BigCalendarPlugin ; private reactComponent : React . ReactElement ; constructor ( leaf , plugin ) { super ( leaf ) ; this . plugin = plugin ; } getDisplayText ( ) { return 'Big Calendar' ; } getIcon ( ) { return "calendar-with-checkmark" ; } getViewType ( ) { return CALENDAR_VIEW_TYPE ; } async onOpen ( ) { await this . plugin . loadSettings ( ) ; InsertAfter = this . plugin . settings . InsertAfter ; StartDate = this . plugin . settings . StartDate ; this . registerInterval ( closeTimerID ) ; this . registerInterval ( closeTaskTimerID ) ; outputTasksResults ( ) ; this . reactComponent = React . createElement ( reactPreview ) ; ReactDOM . render ( this . reactComponent , ( this as any ) . contentEl ) ; } async onClose ( ) { clearInterval ( closeTimerID ) ; clearInterval ( closeTaskTimerID ) ; } } export let InsertAfter ; export let StartDate ;