From 820d40eea4eeb5977889e0ef6c35f9092df44b4b Mon Sep 17 00:00:00 2001
From: Naafiyan Ahmed <naafiyan@gmail.com>
Date: Wed, 10 Aug 2022 17:08:47 -0400
Subject: created placeholder loading box but have to get location of final doc
 to update with loading box

---
 src/client/views/collections/CollectionSubView.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/CollectionSubView.tsx')

diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 2f3f57bac..79f629072 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -462,7 +462,8 @@ export function CollectionSubView<X>(moreProps?: X) {
             let placeholders: Doc[] = [];
             // handle yt case
             if (typeof files === 'string') {
-                placeholders.push(Docs.Create.TextDocument('Loading: ' + text, { ...options, title: text, _width: 400, _height: 30 }));
+                placeholders.push(Docs.Create.LoadingDocument('Loading...', text, 500, 500, { ...options }));
+                // placeholders.push(Docs.Create.TextDocument('Loading: ' + text, { ...options, title: text, _width: 400, _height: 30 }));
             } else {
                 // every other doc type is an array of File
 
@@ -471,7 +472,9 @@ export function CollectionSubView<X>(moreProps?: X) {
                 files.forEach(file => {
                     textStr += file.name + '\n';
                 });
-                placeholders.push(Docs.Create.TextDocument('Loading: \n' + textStr, { ...options, title: files.length + ' files', _width: 500, _height: files.length * 40 }));
+                placeholders.push(Docs.Create.LoadingDocument('Loading...', textStr, 500, 500, { ...options }));
+
+                // placeholders.push(Docs.Create.TextDocument('Loading: \n' + textStr, { ...options, title: files.length + ' files', _width: 500, _height: files.length * 40 }));
             }
             // disposer action to remove placeholders once files are uploaded
             const remove = action(() => {
@@ -498,6 +501,7 @@ export function CollectionSubView<X>(moreProps?: X) {
             clientY: number,
             addDocument: (doc: Doc | Doc[]) => boolean
         ) => {
+            // TODO: once loading thing is moved it should update the x and y of the file it is placeholder for
             const disposer = this.placeHolderDisposer(files, options, text);
             // const disposer = OverlayView.Instance.addElement(<ReactLoading type={'spinningBubbles'} color={'green'} height={250} width={250} />, { x: clientX - 125, y: clientY - 125 });
             if (typeof files === 'string') {
-- 
cgit v1.2.3-70-g09d2

