From e8bd54161e55b8ed429a3c99e05be8ea89653194 Mon Sep 17 00:00:00 2001
From: Monika Hedman <monika_hedman@brown.edu>
Date: Wed, 13 Feb 2019 15:31:29 -0500
Subject: nav beginning

---
 src/client/views/TempTreeView.tsx | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 src/client/views/TempTreeView.tsx

(limited to 'src/client/views/TempTreeView.tsx')

diff --git a/src/client/views/TempTreeView.tsx b/src/client/views/TempTreeView.tsx
new file mode 100644
index 000000000..eeffe6cba
--- /dev/null
+++ b/src/client/views/TempTreeView.tsx
@@ -0,0 +1,47 @@
+import { observable, computed } from "mobx";
+import React = require("react");
+import { observer } from "mobx-react";
+import { Document } from "../../fields/Document";
+import { ListField } from "../../fields/ListField";
+import "./TempTreeView.scss"
+import { DocumentManager } from "./DocumentManager";
+
+export interface IProps {
+    mainCollection: Array<Document>;
+}
+
+@observer
+export class TempTreeView extends React.Component<IProps>{
+
+    onClick(doc: Document) {
+        let view = DocumentManager.Instance.getDocumentView(doc);
+        if (view != null) {
+            console.log(view.Id)
+            console.log(view.props.Document.Title)
+            if (view.props.ContainingCollectionView != undefined) {
+                console.log(view.props.ContainingCollectionView.Id)
+            }
+            else {
+                console.log("containing collection is undefined")
+            }
+        }
+    }
+
+    render() {
+        return (
+            <div className="tempTree">
+                <div className="list">
+                    {this.props.mainCollection.map(doc => {
+                        return (
+                            <div key={doc.Id} onClick={() => { this.onClick(doc) }}>
+                                {doc.Title}
+                            </div>
+                        )
+                    }
+                    )}
+                </div>
+            </div>
+        );
+    }
+
+}
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

