import React, { PropTypes, Component } from 'react'; import { FormattedMessage } from 'react-intl'; import { getSetting } from 'meteor/vulcan:core'; // import Formsy from 'formsy-react'; import FRC from 'formsy-react-components'; const Input = FRC.Input; class ThumbnailURL extends Component { constructor(props) { super(props); this.clearThumbnail = this.clearThumbnail.bind(this); this.showInput = this.showInput.bind(this); this.state = { showInput: false }; } clearThumbnail() { this.context.updateCurrentValues({thumbnailUrl: ""}); } showInput() { this.setState({ showInput: true }); } renderThumbnail() { return (
) } render() { const {name, /* value, */ label} = this.props; const inputType = this.state.showInput ? "text" : "hidden"; return (
{this.props.value ? this.renderThumbnail() : null} {!this.state.showInput ? : null}
) } } ThumbnailURL.propTypes = { name: React.PropTypes.string, value: React.PropTypes.any, label: React.PropTypes.string } ThumbnailURL.contextTypes = { addToPrefilledValues: React.PropTypes.func, updateCurrentValues: React.PropTypes.func, deleteValue: React.PropTypes.func } export default ThumbnailURL;