diff options
author | bobzel <zzzman@gmail.com> | 2023-12-17 22:32:22 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-17 22:32:22 -0500 |
commit | e5b641ce31703b3af0238ff93645fcfa9a3f9168 (patch) | |
tree | ca426342ecbb5b3fe256b56885e63ae7aa32acce /src | |
parent | 63c5625b34d42f33270067c27047d597fd9b46ce (diff) |
small change to calendarView to render calendars
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionCalendarView.tsx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/client/views/collections/CollectionCalendarView.tsx b/src/client/views/collections/CollectionCalendarView.tsx index ad880b815..2cec29669 100644 --- a/src/client/views/collections/CollectionCalendarView.tsx +++ b/src/client/views/collections/CollectionCalendarView.tsx @@ -39,17 +39,13 @@ export class CollectionCalendarView extends CollectionSubView() { _stackRef = React.createRef<CollectionStackingView>(); panelHeight = () => { - return 0; // TODO: change - }; - - panelWidth = () => { - return 0; // TODO: change + return this._props.PanelHeight() - 40; // this should be the height of the stacking view. For now, it's the hieight of the calendar view minus 40 to allow for a title }; // most recent calendar should come first sortByMostRecentDate = (calendarA: Doc, calendarB: Doc) => { - const aDateRangeStr = StrCast(calendarA.date_range); - const bDateRangeStr = StrCast(calendarB.date_range); + const aDateRangeStr = StrCast(DocListCast(calendarA.data).lastElement()?.date_range); + const bDateRangeStr = StrCast(DocListCast(calendarB.data).lastElement()?.date_range); const [aFromDate, aToDate] = dateRangeStrToDates(aDateRangeStr); const [bFromDate, bToDate] = dateRangeStrToDates(bDateRangeStr); @@ -77,24 +73,23 @@ export class CollectionCalendarView extends CollectionSubView() { .scale(this._props.NativeDimScaling?.() || 1); get calendarsKey() { - return this._props.fieldKey + '_calendars'; + return this._props.fieldKey; } render() { return ( - <div> + <div className="collectionCalendarView"> <CollectionStackingView {...this._props} setContentView={emptyFunction} ref={this._stackRef} PanelHeight={this.panelHeight} - PanelWidth={this.panelWidth} + PanelWidth={this._props.PanelWidth} // childFilters={this.childFilters} DO I NEED THIS? sortFunc={this.sortByMostRecentDate} setHeight={undefined} isAnnotationOverlay={false} // select={emptyFunction} What does this mean? - NativeDimScaling={returnOne} isAnyChildContentActive={returnTrue} // ?? // childDocumentsActive={} // whenChildContentsActiveChanged={} @@ -104,9 +99,7 @@ export class CollectionCalendarView extends CollectionSubView() { addDocument={this.addCalendar} ScreenToLocalTransform={this.screenToLocalTransform} renderDepth={this._props.renderDepth + 1} - type_collection={CollectionViewType.Stacking} fieldKey={this.calendarsKey} - pointerEvents={returnAll} /> </div> ); |