From 11134bc5ce01d0a025d311a4f83e67ff6e63ce1c Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Sat, 9 Feb 2019 19:13:24 -0500 Subject: Moved client code to client folder --- src/views/nodes/FieldView.tsx | 56 ------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/views/nodes/FieldView.tsx (limited to 'src/views/nodes/FieldView.tsx') diff --git a/src/views/nodes/FieldView.tsx b/src/views/nodes/FieldView.tsx deleted file mode 100644 index 3a7652284..000000000 --- a/src/views/nodes/FieldView.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React = require("react") -import { Document } from "../../fields/Document"; -import { observer } from "mobx-react"; -import { computed } from "mobx"; -import { Field, Opt, FieldWaiting, FieldValue } from "../../fields/Field"; -import { TextField } from "../../fields/TextField"; -import { NumberField } from "../../fields/NumberField"; -import { RichTextField } from "../../fields/RichTextField"; -import { FormattedTextBox } from "./FormattedTextBox"; -import { ImageField } from "../../fields/ImageField"; -import { ImageBox } from "./ImageBox"; -import { Key } from "../../fields/Key"; -import { DocumentView } from "./DocumentView"; - -// -// these properties get assigned through the render() method of the DocumentView when it creates this node. -// However, that only happens because the properties are "defined" in the markup for the field view. -// See the LayoutString method on each field view : ImageBox, FormattedTextBox, etc. -// -export interface FieldViewProps { - fieldKey: Key; - doc: Document; - DocumentViewForField: Opt -} - -@observer -export class FieldView extends React.Component { - public static LayoutString(fieldType: string) { return `<${fieldType} doc={Document} DocumentViewForField={DocumentView} fieldKey={DataKey} />`; } - @computed - get field(): FieldValue { - const { doc, fieldKey } = this.props; - return doc.Get(fieldKey); - } - render() { - const field = this.field; - if (!field) { - return

{''}

- } - if (field instanceof TextField) { - return

{field.Data}

- } - else if (field instanceof RichTextField) { - return - } - else if (field instanceof ImageField) { - return - } - else if (field instanceof NumberField) { - return

{field.Data}

- } else if (field != FieldWaiting) { - return

{field.GetValue}

- } else - return

{"Waiting for server..."}

- } - -} \ No newline at end of file -- cgit v1.2.3-70-g09d2