render()

in src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js [47:82]


  render() {
    const iframeSrc = this.getIframeLink();

    return (
      <span>
        <button onClick={this.handleOpenModal} className="rw-doc-viewer-open-modal-link">
          {this.props.children}
        </button>
        {this.state.openedModal && (
          <Portal>
            <div className="rw-doc-viewer-modal-fade" aria-hidden="true" onClick={this.handleCloseModal} />
            <div className="rw-doc-viewer-modal">
              <div className="rw-doc-viewer-modal-body">
                {this.state.iFrameLoading && <div className="rw-doc-viewer-spinner" />}
                <iframe
                  src={iframeSrc}
                  title="viewer"
                  className="rw-doc-viewer-modal-iframe"
                  onLoad={this.iframeLoaded}
                  onError={this.updateIframeSrc}
                  ref={(iframe) => {
                    this.iframe = iframe;
                  }}
                />
              </div>
              <div className="rw-doc-viewer-modal-footer">
                <button type="button" className="rw-doc-viewer-close-modal" onClick={this.handleCloseModal}>
                  X
                </button>
              </div>
            </div>
          </Portal>
        )}
      </span>
    );
  }