From 12788cbe0586d0349f70b73d1b6f6a481b4bf2cf Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 5 Jul 2019 17:31:20 -0400 Subject: first pass at implementation of directory import --- src/client/util/Import & Export/KeyValue.tsx | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/client/util/Import & Export/KeyValue.tsx (limited to 'src/client/util/Import & Export/KeyValue.tsx') diff --git a/src/client/util/Import & Export/KeyValue.tsx b/src/client/util/Import & Export/KeyValue.tsx new file mode 100644 index 000000000..15ef25f89 --- /dev/null +++ b/src/client/util/Import & Export/KeyValue.tsx @@ -0,0 +1,79 @@ +import React = require("react"); +import { observer } from "mobx-react"; +import { EditableView } from "../../views/EditableView"; +import { observable, action } from "mobx"; + +interface KeyValueProps { + remove: (self: KeyValue) => void; +} + +@observer +export default class KeyValue extends React.Component { + @observable public key = "Key"; + @observable public value = "Value"; + + @action + updateKey = (newKey: string) => { + this.key = newKey; + return true; + } + + @action + updateValue = (newValue: string) => { + this.value = newValue; + return true; + } + + render() { + let keyValueStyle = { paddingLeft: 10, width: "50%" }; + let keySpecified = (this.key.length > 0 && this.key !== "Key"); + return ( +
this.props.remove(this)} + > + +
+ this.key} + oneLine={true} + /> +
+
+ this.value} + oneLine={true} + /> +
+
+ +
+ ); + } + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2