From 6cd71adb4b35e1afacae5b41d5ab2ac215a1826f Mon Sep 17 00:00:00 2001
From: andrewdkim <adkim414@gmail.com>
Date: Tue, 25 Jun 2019 17:10:46 -0400
Subject: ui and reactions

---
 src/client/views/nodes/Keyframe.tsx | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'src/client/views/nodes/Keyframe.tsx')

diff --git a/src/client/views/nodes/Keyframe.tsx b/src/client/views/nodes/Keyframe.tsx
index 7f4f9ab3b..2ed63a66e 100644
--- a/src/client/views/nodes/Keyframe.tsx
+++ b/src/client/views/nodes/Keyframe.tsx
@@ -15,12 +15,14 @@ import { DocumentView } from "./DocumentView";
 import { anchorPoints, Flyout } from "../TemplateMenu";
 import { LinkMenu } from "./LinkMenu";
 import { faCircle } from "@fortawesome/free-solid-svg-icons";
+import { node } from "prop-types";
 
 
 
 
 interface IProp {
     node: Doc;
+    currentBarX: number; 
 }
 
 @observer
@@ -37,12 +39,16 @@ export class Keyframe extends React.Component<IProp> {
 
     @action
     componentDidMount() {
-        let dv:DocumentView = DocumentManager.Instance.getDocumentView(this.props.node!)!;
-        this._data = new Doc(); 
-        this._position = this.props.node.currentBarX as number; 
-        this._data.duration = 200; 
-        this._data.start = this._position - (this._duration/2); 
-        this._data.end = this._position + (this._duration/2); 
+        this._position = this.props.node.position as number; 
+        reaction (() => this.props.currentBarX, () => {
+            console.log("reaction triggered!"); 
+            if (this.props.currentBarX  !== this._position){
+                this.props.node.hidden = true; 
+            } else {
+                this.props.node.hidden = false; 
+            }
+        }); 
+        
      }
 
     componentWillUnmount() {
-- 
cgit v1.2.3-70-g09d2

