import { observable, computed, action } from "mobx"; import React = require("react"); import { SelectionManager } from "../../util/SelectionManager"; import { observer } from "mobx-react"; import './LinkEditor.scss'; import { props } from "bluebird"; import { DocumentView } from "./DocumentView"; import { link } from "fs"; import { StrCast } from "../../../new_fields/Types"; import { Doc } from "../../../new_fields/Doc"; interface Props { linkDoc: Doc; showLinks: () => void; } @observer export class LinkEditor extends React.Component { @observable private _nameInput: string = StrCast(this.props.linkDoc.title); @observable private _descriptionInput: string = StrCast(this.props.linkDoc.linkDescription); onSaveButtonPressed = (e: React.PointerEvent): void => { e.stopPropagation(); this.props.linkDoc.title = this._nameInput; this.props.linkDoc.linkDescription = this._descriptionInput; this.props.showLinks(); } render() { return (
SAVE
); } @action onNameChanged = (e: React.ChangeEvent) => { this._nameInput = e.target.value; } @action onDescriptionChanged = (e: React.ChangeEvent) => { this._descriptionInput = e.target.value; } }