From d0b90a0a7849cdc06f4332df9ad6eae5342520ca Mon Sep 17 00:00:00 2001
From: Geireann <60007097+geireann@users.noreply.github.com>
Date: Thu, 8 Apr 2021 04:07:42 -0400
Subject: changes

---
 src/client/util/CaptureManager.tsx | 66 +++++++++++++++++++++++++++++++++-----
 1 file changed, 58 insertions(+), 8 deletions(-)

(limited to 'src/client/util/CaptureManager.tsx')

diff --git a/src/client/util/CaptureManager.tsx b/src/client/util/CaptureManager.tsx
index cea0c182f..c38337c91 100644
--- a/src/client/util/CaptureManager.tsx
+++ b/src/client/util/CaptureManager.tsx
@@ -2,11 +2,14 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { action, computed, observable, runInAction } from "mobx";
 import { observer } from "mobx-react";
 import * as React from "react";
-import { Doc } from "../../fields/Doc";
+import { convertToObject } from "typescript";
+import { Doc, DocListCast } from "../../fields/Doc";
 import { BoolCast, StrCast, Cast } from "../../fields/Types";
 import { addStyleSheet, addStyleSheetRule, Utils } from "../../Utils";
+import { LightboxView } from "../views/LightboxView";
 import { MainViewModal } from "../views/MainViewModal";
 import "./CaptureManager.scss";
+import { SelectionManager } from "./SelectionManager";
 import { undoBatch } from "./UndoManager";
 const higflyout = require("@hig/flyout");
 export const { anchorPoints } = higflyout;
@@ -35,23 +38,69 @@ export class CaptureManager extends React.Component<{}> {
     @computed get visibilityContent() {
 
         return <div className="capture-block">
-            <div className="capture-block-title">Visibility
-                <div className="visibility-radio">
-                    <input type="radio" value="private" name="visibility" /> Private
-                    <input type="radio" value="public" name="visibility" /> Public
+            <div className="capture-block-title">Visibility</div>
+            <div className="capture-block-radio">
+                <div className="radio-container">
+                    <input type="radio" value="private" name="visibility" style={{ margin: 0, marginRight: 5 }} /> Private
+                </div>
+                <div className="radio-container">
+                    <input type="radio" value="public" name="visibility" style={{ margin: 0, marginRight: 5 }} /> Public
                 </div>
             </div>
         </div>;
     }
 
     @computed get linksContent() {
+        const doc = this._document;
+        const order: JSX.Element[] = [];
+        if (doc) {
+            console.log('title', doc.title);
+            console.log('links', doc.links);
+            const linkDocs = DocListCast(doc.links);
+            const firstDocs = linkDocs.filter(linkDoc => Doc.AreProtosEqual(linkDoc.anchor1 as Doc, doc) || Doc.AreProtosEqual((linkDoc.anchor1 as Doc).annotationOn as Doc, doc)); // link docs where 'doc' is anchor1
+            const secondDocs = linkDocs.filter(linkDoc => Doc.AreProtosEqual(linkDoc.anchor2 as Doc, doc) || Doc.AreProtosEqual((linkDoc.anchor2 as Doc).annotationOn as Doc, doc)); // link docs where 'doc' is anchor2
+            linkDocs.forEach((l, i) => {
+                if (l) {
+                    console.log(i, (l.anchor1 as Doc).title);
+                    console.log(i, (l.anchor2 as Doc).title);
+                    order.push(
+                        <div className="list-item">
+                            <div className="number">{i}</div>
+                            {(l.anchor1 as Doc).title}
+                        </div>
+                    );
+                }
+            });
+        }
+
         return <div className="capture-block">
             <div className="capture-block-title">Links</div>
-
+            <div className="capture-block-list">
+                {order}
+            </div>
         </div>;
     }
 
-
+    @computed get closeButtons() {
+        return <div className="capture-block">
+            <div className="buttons">
+                <div className="save" onClick={() => {
+                    LightboxView.SetLightboxDoc(this._document);
+                    this.close();
+                }}>
+                    Save
+                </div>
+                <div className="cancel" onClick={() => {
+                    const selected = SelectionManager.Views().slice();
+                    SelectionManager.DeselectAll();
+                    selected.map(dv => dv.props.removeDocument?.(dv.props.Document));
+                    this.close();
+                }}>
+                    Cancel
+                </div>
+            </div>
+        </div>
+    }
 
 
 
@@ -72,6 +121,7 @@ export class CaptureManager extends React.Component<{}> {
             <div className="close-button" onClick={this.close}>
                 <FontAwesomeIcon icon={"times"} color="black" size={"lg"} />
             </div>
+            {this.closeButtons}
         </div>;
 
     }
@@ -82,7 +132,7 @@ export class CaptureManager extends React.Component<{}> {
             isDisplayed={this.isOpen}
             interactive={true}
             closeOnExternalClick={this.close}
-            dialogueBoxStyle={{ width: "500px", height: "300px", border: "none", background: Cast(Doc.SharingDoc().userColor, "string", null) }}
+            dialogueBoxStyle={{ width: "500px", height: "350px", border: "none", background: "whitesmoke" }}
             overlayStyle={{ background: "black" }}
             overlayDisplayedOpacity={0.6}
         />
-- 
cgit v1.2.3-70-g09d2

