From bece3110a3d6fa18dd89415a5e636c6792aea4e1 Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Wed, 20 Mar 2019 05:07:52 -0400
Subject: Refactored users to have a single user document instead of a list of
 workspaces

---
 .../authentication/controllers/WorkspacesMenu.tsx     | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

(limited to 'src/server/authentication/controllers/WorkspacesMenu.tsx')

diff --git a/src/server/authentication/controllers/WorkspacesMenu.tsx b/src/server/authentication/controllers/WorkspacesMenu.tsx
index 1533b1e62..8e14cf98e 100644
--- a/src/server/authentication/controllers/WorkspacesMenu.tsx
+++ b/src/server/authentication/controllers/WorkspacesMenu.tsx
@@ -9,30 +9,23 @@ import { KeyStore } from '../../../fields/KeyStore';
 export interface WorkspaceMenuProps {
     active: Document | undefined;
     open: (workspace: Document) => void;
-    new: (init: boolean) => void;
+    new: () => void;
     allWorkspaces: Document[];
+    isShown: () => boolean;
+    toggle: () => void;
 }
 
 @observer
 export class WorkspacesMenu extends React.Component<WorkspaceMenuProps> {
-    static Instance: WorkspacesMenu;
-    @observable private workspacesExposed: boolean = false;
-
     constructor(props: WorkspaceMenuProps) {
         super(props);
-        WorkspacesMenu.Instance = this;
         this.addNewWorkspace = this.addNewWorkspace.bind(this);
     }
 
     @action
     addNewWorkspace() {
-        this.props.new(false);
-        this.toggle();
-    }
-
-    @action
-    toggle() {
-        this.workspacesExposed = !this.workspacesExposed;
+        this.props.new();
+        this.props.toggle();
     }
 
     render() {
@@ -45,7 +38,7 @@ export class WorkspacesMenu extends React.Component<WorkspaceMenuProps> {
                     borderRadius: 5,
                     position: "absolute",
                     top: 78,
-                    left: this.workspacesExposed ? 11 : -500,
+                    left: this.props.isShown() ? 11 : -500,
                     background: "white",
                     border: "black solid 2px",
                     transition: "all 1s ease",
-- 
cgit v1.2.3-70-g09d2

