From 34a8b9dd402a247e7ad0a57115935b1e3a04a8d3 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sat, 12 Oct 2019 12:25:02 -0400
Subject: cleaned up notifs and bottom menu icons

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

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

diff --git a/src/client/views/MainViewNotifs.tsx b/src/client/views/MainViewNotifs.tsx
new file mode 100644
index 000000000..09fa1cb0c
--- /dev/null
+++ b/src/client/views/MainViewNotifs.tsx
@@ -0,0 +1,32 @@
+import { action, computed, observable } from 'mobx';
+import { observer } from 'mobx-react';
+import "normalize.css";
+import * as React from 'react';
+import { Doc, DocListCast, Opt } from '../../new_fields/Doc';
+import { emptyFunction } from '../../Utils';
+import { SetupDrag } from '../util/DragManager';
+import "./MainViewNotifs.scss";
+import { CollectionDockingView } from './collections/CollectionDockingView';
+
+
+@observer
+export class MainViewNotifs extends React.Component {
+
+    @observable static NotifsCol: Opt<Doc>;
+    openNotifsCol = () => {
+        if (MainViewNotifs.NotifsCol) {
+            CollectionDockingView.AddRightSplit(MainViewNotifs.NotifsCol, undefined);
+        }
+    }
+    render() {
+        const length = MainViewNotifs.NotifsCol ? DocListCast(MainViewNotifs.NotifsCol.data).length : 0;
+        const notifsRef = React.createRef<HTMLDivElement>();
+        const dragNotifs = action(() => MainViewNotifs.NotifsCol!);
+        return <div className="mainNotifs-container" ref={notifsRef}>
+            <button className="mainNotifs-badge" style={length > 0 ? { "display": "initial" } : { "display": "none" }}
+                onClick={this.openNotifsCol} onPointerDown={MainViewNotifs.NotifsCol ? SetupDrag(notifsRef, dragNotifs) : emptyFunction}>
+                {length}
+            </button>
+        </div>;
+    }
+}
-- 
cgit v1.2.3-70-g09d2

