From 3cdc6f11e262e289b6070d6fa75a59fff7e59b1e Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Wed, 3 Jul 2019 13:42:20 -0400
Subject: Added state to layout scripts

---
 src/client/views/ScriptBox.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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

diff --git a/src/client/views/ScriptBox.tsx b/src/client/views/ScriptBox.tsx
index aea9d52a4..fa236c2da 100644
--- a/src/client/views/ScriptBox.tsx
+++ b/src/client/views/ScriptBox.tsx
@@ -2,15 +2,23 @@ import * as React from "react";
 import { observer } from "mobx-react";
 import { observable, action } from "mobx";
 
+import "./ScriptBox.scss";
+
 export interface ScriptBoxProps {
     onSave: (text: string, onError: (error: string) => void) => void;
     onCancel?: () => void;
+    initialText?: string;
 }
 
 @observer
 export class ScriptBox extends React.Component<ScriptBoxProps> {
     @observable
-    private _scriptText: string = "";
+    private _scriptText: string;
+
+    constructor(props: ScriptBoxProps) {
+        super(props);
+        this._scriptText = props.initialText || "";
+    }
 
     @action
     onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
-- 
cgit v1.2.3-70-g09d2

