From 483aa393cd004e97e2722fea52e920379099cb4d Mon Sep 17 00:00:00 2001
From: Stanley Yip <stanley_yip@brown.edu>
Date: Thu, 6 Feb 2020 16:59:52 -0500
Subject: oops

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

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

diff --git a/src/client/views/TouchScrollableMenu.tsx b/src/client/views/TouchScrollableMenu.tsx
new file mode 100644
index 000000000..4bda0818e
--- /dev/null
+++ b/src/client/views/TouchScrollableMenu.tsx
@@ -0,0 +1,59 @@
+import React = require("react");
+import { computed } from "mobx";
+import { observer } from "mobx-react";
+
+export interface TouchScrollableMenuProps {
+    options: JSX.Element[];
+    bounds: {
+        right: number;
+        left: number;
+        bottom: number;
+        top: number;
+        width: number;
+        height: number;
+    };
+    selectedIndex: number;
+    x: number;
+    y: number;
+}
+
+export interface TouchScrollableMenuItemProps {
+    text: string;
+    onClick: () => any;
+}
+
+@observer
+export default class TouchScrollableMenu extends React.Component<TouchScrollableMenuProps> {
+
+    @computed
+    private get possibilities() { return this.props.options; }
+
+    @computed
+    private get selectedIndex() { return this.props.selectedIndex; }
+
+    render() {
+        return (
+            <div className="inkToTextDoc-cont" style={{
+                transform: `translate(${this.props.x}px, ${this.props.y}px)`,
+                width: 300,
+                height: this.possibilities.length * 25
+            }}>
+                <div className="inkToTextDoc-scroller" style={{ transform: `translate(0, ${-this.selectedIndex * 25}px)` }}>
+                    {this.possibilities}
+                </div>
+                <div className="shadow" style={{ height: `calc(100% - 25px - ${this.selectedIndex * 25}px)` }}>
+                </div>
+            </div>
+        )
+    }
+}
+
+export class TouchScrollableMenuItem extends React.Component<TouchScrollableMenuItemProps>{
+    render() {
+        return (
+            <div className="menuItem-cont" onClick={this.props.onClick}>
+                {this.props.text}
+            </div>
+        )
+    }
+}
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

